Commit Graph

70 Commits

Author SHA1 Message Date
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
ritiek
6ac25bda0c Fix KeyError when ISRC info unavailable 2017-07-20 05:18:52 +05:30
Ritiek Malhotra
4a2bbb2535 Expect Python to be already in PATH (#114)
* Expect python to already be in PATH

* Expect python to be in PATH

* Fix special handlling of conversion on windows

* Some cleaning

* Update docs
2017-07-17 20:25:11 +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
ritiek
ce3a6c3d5a Replace '/' with '_' instead of deleting it 2017-07-12 00:03:38 +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
75be7285c0 Add description of the new -f option in README.md; Fix minor issues 2017-07-11 18:48:02 +02:00
Ritiek Malhotra
e1ef35b6b9 Fix avconv conversion for -f option 2017-07-11 22:02:13 +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
b677a5454e Catch None TypeError when comparing metadata 2017-07-06 19:21:47 +05:30
Ritiek Malhotra
d03da58fed Fix windows specific encoding errors 2017-06-29 13:04:19 +05:30
Ritiek Malhotra
edbec52629 Fix windows specific encoding errors 2017-06-29 13:02:42 +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
Linus
0f384bb5ee Add docstrings; Remove verbose comments; Fix errors introduced with cleanup
This comment will:
- Transform docstrings above functions into docstrings
- Remove some way too verbose comments
- Apply some more recommendations from PEP8 forgotten last time
- Fix some errors introduced with the first code cleanup

Work left to do:
- Add params to docstrings
- Rename file variables
2017-06-28 16:21:58 +02:00
Linus
587f907ed8 Apply most best practices of PEP 8
This refactoring includes:
- Two empty lines before each global function
- Using '{0} {1}'.format(str1, str2) instead of str1 + ' ' + str2
  Sometimes this will make lines longer, sometimes shorter.
- Starting all comments with # + space + comment
- Make lines not longer than 80 characters in most cases
- Renaming some variables to make more sense
- Add some missing code like returns and Exceptions

Not included, but follows:
- Make some comments docstrings
- Rename all 'file' variables, only for Python 2
- Remove some way too verbose comments ;)
2017-06-28 16:21:58 +02:00
Ritiek
8af2479389 Update mechanism for fetching playlist tracks 2017-06-26 19:44:02 +05:30
Ritiek Malhotra
93469bbfd9 Fix TypeError in python3 on conversion 2017-06-25 20:59:56 +05:30
Ritiek
ccebb8a002 Remove unnecessary return 2017-06-25 11:35:23 +05:30
Ritiek
e18a74ccc3 Add metadata test 2017-06-25 02:34:55 +05:30
Ritiek
e0fb227ea5 Add conversion test 2017-06-25 01:41:57 +05:30
Ritiek
93244e46ec Fix download test 2017-06-25 01:16:04 +05:30
Ritiek
0dfaf183b5 Test YouTube track title 2017-06-25 00:31:57 +05:30
Ritiek
ae29ff8f87 Split conversion code 2017-06-24 21:49:19 +05:30
Ritiek
fb3c7e9ec3 Improve metadata fixing mechanism 2017-06-24 20:38:06 +05:30
Ritiek
23e44c1158 Skip if copyright info unavailable 2017-06-23 09:47:29 +05:30
Ritiek
5eba56d125 Message if audio stream not available on YouTube 2017-06-22 13:45:43 +05:30
Ritiek
258b21ff05 Fix getting input in python3 2017-06-22 02:27:18 +05:30
Ritiek
acfb2f0173 Fix encoding problems hopefully 2017-06-21 14:13:32 +05:30
Ritiek
5aa8c66db3 Small encoding changes 2017-06-21 12:58:15 +05:30
Ritiek
1848d3a16d Fix encoding error when getting YT track title 2017-06-21 00:52:18 +05:30
Ritiek
0c328079a8 Fix encoding problems in python2 2017-06-21 00:34:24 +05:30
Ritiek Malhotra
f36b3cc3f0 Remove unnecessary fix_encoding() 2017-06-20 22:29:51 +05:30
Ritiek
86506307ff Add instructions for getting FFmpeg up 2017-06-20 20:51:28 +05:30
Ritiek
20d4d7c2d5 Change defaults to FFmpeg 2017-06-20 20:25:47 +05:30