Commit Graph

107 Commits

Author SHA1 Message Date
Linus Groh
7f7c3d6f58 Update youtube_tools.py 2018-03-10 12:27:16 +01:00
Ritiek Malhotra
2cc9a4a9d3 Update YouTube API key to not conflict with users before #250 2018-03-09 20:52:46 +05:30
Ritiek Malhotra
b968b5d206 Scrape YouTube by default and optionally use YouTube API to perform searches (#250)
* YouTube scraping

* Cleanup GenerateYouTubeURL class

* Some minor improvements

* Add test to fetch title with and without api key
2018-03-09 20:40:15 +05:30
Vishnunarayan K I
4ad77de97f Filter out items other than videos in search (#249) 2018-03-09 13:17:46 +05:30
ritiek
f943080edb Partially fix download speed throttle 2018-02-25 03:34:59 +05:30
ritiek
c8db9ed5da Improve conversion 2018-02-13 18:03:50 +05:30
Nitesh Sawant
a8f261edae Changes as per second PR review 2018-02-05 23:01:44 +05:30
Nitesh Sawant
0e3249646f Made Changes as per comments on PR
removed the unnecessary comma and space at the end!
 put the closing bracket on the previous line, as it's done with all the other parser.add_argument calls.
remove the pass - it's completely unneccesary.
2018-02-04 22:36:04 +05:30
Nitesh Sawant
8550abd06a Removed unnecessary imports 2018-02-04 16:07:39 +05:30
Nitesh Sawant
e1ffa92b9c wrote help description for
def override_config
2018-02-04 16:01:37 +05:30
Nitesh Sawant
6bd2a71666 Implemented passing config.yml as command line argument 2018-02-04 15:46:08 +05:30
Ritiek Malhotra
08ae7ae24a Use our token with pafy (#228) 2018-01-30 19:47:26 +05:30
Ritiek Malhotra
ffb4764074 Remove some debug code 2018-01-29 21:45:36 +05:30
Ritiek Malhotra
3e6b2d7702 Increase coverage (#218)
* Monkeypatch fetch user and use pytest.tempdir

* Cover spotify_tools.grab_album()

* Cover avconv conversion

* Cover grab_single()

* Reduce code repetition

* Move grab_playlist() to spotify_tools.py

* Move Spotify specific functions to spotify_tools.py

* Refactoring

* Return track list from write_tracks()

* Fix tests

* Cover more cases in generate_youtube_url()

* Test for unavailable audio streams

* Test for filename without spaces

* handle.py 100% coverage

* Improve config tests

* Speed up tests

* Install avconv and libfdk-aac

* Some cleaning

* FFmpeg with libfdk-aac, libopus

* Some refactoring

* Convert tmpdir to string

* Cover YouTube title when downloading from list

* Explicitly cover some internals.py functions
2018-01-26 20:44:37 +05:30
Linus Groh
8fd28c81ae Improve spaces replacement with slugify 2018-01-24 17:36:20 +01:00
Linus Groh
4a940ab09f Fix spaces not being replaced by dashes when no metadata is found (#220) 2018-01-24 17:10:14 +01:00
Suhas Karanth
caba5a1c3b Fix already_tagged check for mp4 in metadata.py>compare (#219) 2018-01-24 21:03:00 +05:30
Linus Groh
972065b7c9 Some code refactoring 2018-01-24 16:24:19 +01:00
Nitesh Sawant
8dae25fb42 Tell the user to install unicode-slugify in case of ImportError #176 (#206) 2018-01-23 22:10:03 +05:30
vn-ki
9d87424860 Beautify videotime_from_seconds func 2018-01-23 04:12:42 +05:30
Ritiek Malhotra
fcfebc55e6 Save file names using a custom format specifiers (#205)
* Use custom formats to generate file name

* Do not mess up search term

* Fix tests

* Fix conflicting names

* Fix subprocess call on file paths with spaces

* Create directories and keep spaces as defaults

* Fix config merge

* Remove underscores from default file format

* Remove debug info

* Show possible formats in usage help
2018-01-19 13:58:27 +05:30
Miguel Piedrafita
1fe94c9896 Add a config option to preserve spaces in file names (#201)
* Add a config option to preserve spaces in file names

* Typo

* Fix replacing in path
2018-01-15 13:41:11 +05:30
Ritiek Malhotra
9f35471f3a Read configuration from config.yml (#200)
* Read from config.yml

* Mention config.yml

* Require PyYAML >= 3.12
2018-01-13 16:59:44 +05:30
ritiek
621e1eb21e Some cleanup 2018-01-12 21:52:43 +05:30
ritiek
b226b8380a Resolve imports 2018-01-12 17:34:01 +05:30
ritiek
da68ca3989 Fix conflicts 2018-01-12 17:09:13 +05:30
ritiek
8c76bd8ea3 Fix conflicts 2018-01-12 15:56:09 +05:30
ritiek
fce2a1abcd Fix tests and const.py to hold options 2018-01-11 21:50:40 +05:30
Ritiek Malhotra
58cfa121f3 Write lyrics to track metadata (#194)
* TODO: Don't throw traceback if no lyrics found

* Add more metadata fields

* Refactor debug logging

* Fix traceback when lyrics not found

* It already vomits metadata :3

* Bump lyricwikia >= 0.1.8
2018-01-11 02:13:23 +05:30
Nitesh Sawant
fb70ad32bb Download only songs whose metadata is found #193 (#197) 2018-01-11 01:51:49 +05:30
ritiek
77dab0665d Create youtube_tools.py 2018-01-10 21:20:35 +05:30
ritiek
a117064791 Refactor conversion and minor changes to metadata 2018-01-10 20:01:37 +05:30
ritiek
ea6d52999f Refactor metadata 2018-01-09 17:12:26 +05:30
ritiek
a6028e2155 Split spotify functions 2018-01-09 15:26:42 +05:30
Vishnunarayan K I
4d664956cd Switch to youtube API (#191)
* Switch to youtube API

* Fix test failures

* Minor fix
2018-01-06 18:28:36 +05:30
Ritiek Malhotra
090cdd1c59 Add --dry-run option (#190) 2018-01-06 13:02:07 +05:30
Victor Yap
01bb783724 Add --overwrite option (#182)
* Add overwrite option

* Fix tests

* address changes requested
2017-12-31 12:43:34 +05:30
ritiek
fe11ade687 Log name if song already exists 2017-12-15 20:10:57 +05:30
Ritiek Malhotra
df513acc35 Add logging capability (#175)
* Refactoring and addition of logzero (#172)

* Refactored convert.py and added logging.

* Added logging and refactored.

* Added logzero to requirements.txt

* Added logging to metadata.py

* Created a log in misc.py. Updated slugify import.

* Some general improvement

* Improve message layout

* Improve test mechanism

* Implement debug level logging

* Fix some minor mistakes

* Make pytest happy

* Remove unimplemented --verbose option

* Update ISSUE_TEMPLATE.md

* Rename LICENSE

* Remove obvious from log.debug()

* Show track URL when writing to file (debug)
2017-12-15 19:57:57 +05:30
Aareon Sullivan
77baa71d24 Minor tweaks (#154)
* Minor tweaks

Use at your own risk. Just thought I’d contribute at least a little bit

* Exit code 0

Exit code 0 is standard for notifying the system of a regular, non-error exit.

* No longer need unnecessary flag

* Fix `already_tagged` not defined

* <3 Zen of Python

* Silly me
2017-12-08 15:17:36 +05:30
ritiek
d39272d6a2 Avoid use of os.chdir() 2017-11-30 10:20:36 +05:30
ritiek
618476eca7 Update ISRC metadata 2017-11-13 21:33:29 +05:30
ritiek
2f0018adce Fix ValueError if publisher not found 2017-10-20 14:27:37 +05:30
Valérian Galliat
237b4cca7e Add an option to grab an album (#142) 2017-10-08 19:43:55 +05:30
ritiek
9068f6008e Fix albumart exception in .M4A downloads 2017-09-27 10:26:03 +05:30
ritiek
f9e85d3796 albumart out of range exception 2017-09-27 10:22:25 +05:30
Ritiek Malhotra
97a8c21eb9 Download songs using YouTube URL (#135)
* Download from YouTubr URL

* Slugify title only for YouTube URL's
2017-09-27 09:56:47 +05:30
Luke Garrison
9d25197a5f Improves accuracy of selected youtube video
Finds a balance between viewcount (Youtube's relevancy) and proper song
duration based on Spotify duration. Thus, a Youtube video that is 30
seconds longer than the Spotify track will not be considered

Takes the first result from Youtube (using Youtube's original ordering
based on relevance) that has a similar duration to the Spotify song

Fixes a bug where if there were no suitable videos for a song, the
program would infinitely loop. The program will now retry to find a song
up to 5 times before moving on (this is necessary because occasionally the
song isn't properly fetched or parsed from Youtube)

Fixes bug where songs that are retried were appended to the playlist
file without being separated by a newline
2017-08-09 21:42:31 -04:00
ritiek
67f594c7b0 Don't view sort results if metadata not found 2017-08-02 17:49:16 +05:30
ritiek
146f70c8a7 Sort search results by viewcount 2017-07-21 11:24:56 +05:30