Commit Graph

39 Commits

Author SHA1 Message Date
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
ritiek
ed235610ad Move common code to loader.py 2018-01-15 14:20:12 +05:30
ritiek
f9d9c7d5fa Refactor tests 2018-01-12 21:56:58 +05:30
ritiek
621e1eb21e Some cleanup 2018-01-12 21:52:43 +05:30
ritiek
fce2a1abcd Fix tests and const.py to hold options 2018-01-11 21:50:40 +05:30
ritiek
77dab0665d Create youtube_tools.py 2018-01-10 21:20:35 +05:30
ritiek
91fb0c3e50 Fix tests 2018-01-10 16:25:41 +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
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
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
b4619d0621 Fix tests 2017-11-14 00:00:08 +05:30
ritiek
0178307b20 Use tinydownload to download ffmpeg binary 2017-08-12 19:33:38 +05:30
Ritiek Malhotra
6ff72b0495 Update ffmpeg_bin.py 2017-08-03 10:40:32 +00:00
Ritiek Malhotra
fa5ec719f4 Download FFmpeg binary instead of compiling 2017-08-03 10:31:36 +00:00
Ritiek Malhotra
d1ae0c05a6 Delete ffmeg_bin.py 2017-08-03 10:31:07 +00:00
Ritiek Malhotra
93f45badbf Download ffmpeg binary instead of compiling 2017-08-03 10:27:24 +00:00
ritiek
6401eca454 Optimize and add non-spotify tests 2017-07-25 01:13:22 +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
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
Ritiek Malhotra
0a5ac043f3 Fix test_check_exists2() 2017-07-06 22:44:09 +05:30
Ritiek Malhotra
484d81ef2e Fix failing of consecutive tests 2017-07-06 19:05:05 +05:30
Linus
920c065fd8 Fix last errors of PEP8 refactoring 2017-07-05 21:28:27 +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
6860151d78 Handle playlists with more than 50 tracks 2017-06-26 14:43:38 +05:30
Ritiek
2b0a3cc909 Switch to shorter song to lower test duration 2017-06-25 14:15:39 +05:30
Ritiek
532bd892b0 Update metadata test 2017-06-25 13:49:27 +05:30
Ritiek
e329fe9f36 Update metadata test 2017-06-25 13:48:54 +05:30
Ritiek
d13113c7fe Add username and list test 2017-06-25 12:47:56 +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
142d14118b Add more basic tests 2017-06-25 01:05:25 +05:30
Ritiek
0dfaf183b5 Test YouTube track title 2017-06-25 00:31:57 +05:30
Ritiek
5975fa19e9 Test spotify generated songname 2017-06-25 00:06:04 +05:30
Ritiek
69634475ad Test spotify generated songname 2017-06-25 00:04:21 +05:30