Commit Graph

178 Commits

Author SHA1 Message Date
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
3f17ec1f8a Flake encoder WARN 2018-01-06 19:08:11 +05:30
ritiek
ee340db2ea WARN if encoder not found 2018-01-06 19:01:47 +05:30
ritiek
90b08b3334 Remove BeautifulSoup dependency (as of #191) 2018-01-06 18:42:22 +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
Linus Groh
e175608135 Change return code for KeyboardInterrupt 2018-01-04 13:13:15 +01:00
Linus Groh
0af4a13c2b Change shebang in spotdl.py 2018-01-04 13:07:02 +01:00
Victor Yap
01bb783724 Add --overwrite option (#182)
* Add overwrite option

* Fix tests

* address changes requested
2017-12-31 12:43:34 +05:30
Ritiek Malhotra
93388418f0 Show filepath in debug mode 2017-12-21 13:24:36 +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
Ritiek Malhotra
8ea89f9d1c Import sys to deal with sys.exit() 2017-12-09 00:36:30 +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
84b6ec601b Remove debug code 2017-12-05 22:29:20 +05:30
ritiek
9bee8d8787 Fix parameters to write_playlist() with -u option 2017-12-05 22:28:21 +05:30
Ritiek Malhotra
6075a829e5 Return codes depicting success/failure (#164)
* Add error codes for fetch playlist failures

* Add return codes to README.md
2017-11-30 10:44:46 +05:30
ritiek
d39272d6a2 Avoid use of os.chdir() 2017-11-30 10:20:36 +05:30
fanlp3
6ac60000e6 fixes: #159 Refactored grab_playlist (#160)
* Refactored grab_playlist

grab_playlist was looping through the user's playlist until it finds the playlist.
In some cases a public playlist isn't in the user's playlists
Using a more direct approach, querying for the tracks of a playlist

* Remove old `def write_playlist()`

* Playlist URL download now works on private playlists
2017-11-30 09:49:38 +05:30
ritiek
ade74e8272 Call generate_metadata() only once 2017-11-13 23:45:59 +05:30
ritiek
618476eca7 Update ISRC metadata 2017-11-13 21:33:29 +05:30
ritiek
0deea6b384 Fix error when playlist not found 2017-11-11 19:17:10 +05:30
Ritiek Malhotra
fd130f8626 Error out if playlist not found 2017-11-11 19:13:37 +05:30
Ritiek Malhotra
cfd392c6ce Fix access token regeneration 2017-10-28 01:07:50 +05:30
Ritiek Malhotra
2780ba405f Catch only IndexError 2017-10-27 14:37:26 +05:30
Valérian Galliat
237b4cca7e Add an option to grab an album (#142) 2017-10-08 19:43:55 +05:30
Ritiek Malhotra
98d21bbad9 Fix NoneType not scriptable if song not on Spotify (#140) 2017-09-29 12:38:15 +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
Pierre Gérard
633fb9b1bd [fix] add wait to avoid infinite retry looping (#126) 2017-08-30 20:01:23 +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
I-Al-Istannen
dbaa890976 Added handling for when there simply is no video
Just return None if no video could be found. Makes it skip instead of error out.
2017-07-24 23:01:05 +02:00
ritiek
5d4f2d5148 Fix traceback when metadata not found 2017-07-25 00:37:37 +05:30
ritiek
6ac25bda0c Fix KeyError when ISRC info unavailable 2017-07-20 05:18:52 +05:30
WMP
4cf8a210bf Change for automatical download video with this same duration as spotify song (#111)
* Changes in .gitignore file:
 - added .python-version
This file is used in pyenv to select good python version.

Changes in core/misc.py:
 - added function get_sec to convert HH:mm:ss to seconds

Changes in spotdl.py:
 - in function generate_songname
     change function to receive generate_metadata, this is optymalization, becouse in oldest version metadata from spotify api is downlaoded 2 times
 - in function generate_youtube_url
     song variable use changed function generate_songname
     function now looking for songs in while, and save data to dict. Dictionary is used in manual and auto mode. In dictionary keep is youtube link, title, videotime (in format HH:mm:ss) and videotime converted to seconds.
     For now in automatic downloading is selected video with least difference betwen youtube video time and time from spotify. This is important, becouse in youtube a lot of movies has scenes before/after without musics.

* Fix parameter in generate_songname() and dual calls

* Fix tests

* Skip tests that depend on the location (for the moment)

* Remove unnecessary code
2017-07-17 20:20:29 +05:30
Ritiek Malhotra
9564a71035 Add -p option to directly download playlists with URL (#110)
* Rough implementation of playlist link

* Clean code

* Add information about playlist URL

* Update README.md

* Fix bug where script selects wrong playlist

* Minor improvements

* Minor improvements
2017-07-12 13:37:15 +05:30
Rutger Rauws
d28ff08a69 Use a Spotify song's title instead of a YouTube video's title (#99)
* Use a Spotify song's title instead of a YouTube video's title

* Added fallback to YouTube title if song's metadata cannot be fetched from Spotify

* Removed duplicate generation of metadata

* Fix test cases that use download_song(..) and generate_filename(..)

* Fix conflicting function

* Fix conflict in check_exists()

* Fix filenames for non spotify songs

* Fix some bugs

* Some documentation changes

* Remove unnecessary determine_filename()
2017-07-11 23:14:56 +05:30
Linus
cc7260dfa6 Add command line option for target folder (-f) 2017-07-11 18:16:41 +02:00
Ritiek Malhotra
5add1fd0f8 Drop python 2 compatibility (#107) 2017-07-11 20:32:26 +05:30
°Kelvin R
a1544bc1c8 Repo in one folder, typos + additions, better layout (#105)
* fix #100

* typos and additions

* better layout for playlists

* typo typo and some changes

* was in the wrong line

* also changed path to avconv.exe
2017-07-09 18:01:46 +05:30
Ritiek Malhotra
b0c3627f51 Fixes #104 2017-07-09 11:27:52 +05:30
WMP
90553875a6 Show youtube link in manual mode (#102) (Fixes #101)
My changes for #101 issue
2017-07-07 23:09:04 +05:30
Ritiek Malhotra
0f0b4bc086 Fix UnicodeDecodeError when retreiving some titles 2017-07-06 17:06:58 +05:30
Linus
0bc484e032 Resolve merge conflict due to refactoring 2017-07-05 21:32:51 +02:00
Linus
920c065fd8 Fix last errors of PEP8 refactoring 2017-07-05 21:28:27 +02:00
Ritiek Malhotra
6307d1e775 Fix windows specific encoding errors 2017-06-29 13:02:03 +05:30
Ritiek
3009fb8583 Fix encoding errors 2017-06-29 12:34:27 +05:30
Linus
e20be5d97e Fix errors introduced with previous code cleanup 2017-06-28 16:21:58 +02:00