Commit Graph

69 Commits

Author SHA1 Message Date
Ritiek Malhotra b58c4775f2 Run black formatter on the whole codebase (#460) 2019-01-02 19:22:50 +00:00
Ritiek Malhotra c6bc994658 Fix conflicts caused by merge of #459 2019-01-03 00:43:37 +05:30
Ritiek Malhotra 53dd292b55 Fix conversion conflicts when both input and output filenames are same (#459)
* Workaround conversion conflicts by appending '.temp' to input filename

* Fix tests

* Add a test and some minor changes

* Update CHANGES.md
2019-01-02 18:54:27 +00:00
Ritiek Malhotra 0d0a85b761 Some updates for using spotdl as library 2018-12-29 14:56:00 +05:30
Ritiek Malhotra fbc04671d8 Use Black to format code 2018-12-29 14:09:34 +05:30
Ritiek Malhotra 51b01fc448 [WIP] Monkeypatch tests (#448)
* Parameterize test_internals.py

* Create test_spotify_tools.py

* Monkeypatch pafy.download

* Monkeypatch YouTube search page

* Replace globals with fixtures

* Add missing urllib import, re-ordering and rename test_with_metadata.py

* Avoid creating temp directory in current working directory during test

* Update CHANGES.md
2018-12-26 17:15:56 +05:30
Ritiek Malhotra eae9316cee [WIP] Refactor spotdl.py; introduced classes (#410)
* Refactor spotdl.py; introduced classes

* introduce CheckExists class

* Move these classes to download.py

* Fix refresh_token

* Add a changelog entry
2018-11-25 17:07:56 +05:30
Ritiek Malhotra c685fa2bfd Rere-fix tests 2018-11-13 21:27:21 +05:30
Manveer Basra 20b5e44ed4 --list flag accepts only text files using mimetypes (#414)
* --list flag accepts only text files using mimetypes

* Refactored for consistency

* Workaround to make tests pass
2018-10-29 23:00:35 -07:00
Ritiek Malhotra be4bb25c96 Filter unwanted text from Spotify URLs when extracting information (#394)
* Split unwanted URL part

* Convert get_splits() -> extract_spotify_id()

* Add tests for extract_spotify_id()

* Extract Spotify artist ID when fetching artist albums
2018-10-26 18:29:29 +05:30
Ritiek Malhotra f65034f17e Create a custom user for tests (#405) 2018-10-22 23:03:06 +05:30
Ritiek Malhotra b12ca8c785 Add support for .m3u playlists (#401)
* Add support for .m3u playlists

* Run black code formatter on changes

* Stay consistent with Spotify test track
2018-10-20 16:19:14 +05:30
Manveer Basra 7d321d9616 Changed test track to one whose lyrics are found (#400)
* Changed test track to one whose lyrics are found

* Fixed incorrect values

* Update playlists test to reflect change in playlist
2018-10-19 20:25:50 +05:30
AlfredoSequeida 2b42f0b3a1 added the ability to get all artist's songs as suggested by #366 (#389)
* added the ability to get all artist's songs as suggested by #366

* added log to featch_all_albums_from_artist function and removed the use of a uri

* updated the functionality to get all albums with the ability to get singles

* updated main function with new write_all_albums_from_artist function to get all albums from an artist

* fixed typos

* updated test case for getting all albums from artist

* fixed typos
2018-10-10 23:53:10 -07:00
Linus Groh 13c83bd225 Introduce usage of black (code formatter) (#393) 2018-10-09 00:57:11 -07:00
Linus Groh 2725402ab3 Update tests (#384)
* Update tests

* Move comment regarding changing YT URLs to the appropriate assert
2018-10-02 15:43:21 +05:30
Ritiek Malhotra e076d11a19 Overwrite track file with unique tracks 2018-10-02 12:36:55 +05:30
Ritiek Malhotra e0c8960906 Changes for v1.0.0 release (#345)
* Move spotdl.py inside spotdl directory

* Fix Dockerfile

* Re-upload FFmpeg binary

* Small fixes ;)
2018-09-09 08:00:01 -07:00
Ritiek Malhotra eb96aa8c13 Handle '.' as a time value separator (#301) 2018-07-04 18:27:14 +05:30
Ritiek Malhotra dfcb07ed45 Change default music folder (#225)
* Get default music folder via xdg-user-dirs

* Add a test
2018-04-22 21:14:47 +05:30
Ritiek Malhotra 745066a646 Update search query! 2018-04-18 23:13:42 +05:30
Ritiek Malhotra b6dbc5c00a Show complete list of tracks if metadata not found in manual mode (#266)
* Show complete list of tracks if metadata not found in manual mode

* Add regression test
2018-04-18 19:31:29 +05:30
Ritiek Malhotra fc226442fe Custom YouTube search string (#261)
* Custom YouTube search string

* Fix sorting issues on < Python 3.6
2018-04-08 15:56:44 +05:30
Ritiek Malhotra 96ab547c5c Support FLAC output format (#259)
* Convert to .flac option

* Embed metadata to FLAC

* Update usage help

* Write tests
2018-04-02 00:47:31 +05:30
Ritiek Malhotra c5846d615e Update test for new API key 2018-03-09 20:57:19 +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
Ritiek Malhotra 46f313777b Update music only URL 2018-03-09 16:10:59 +05:30
Ritiek Malhotra c4bb047187 Test URL is now None 2018-02-24 15:03:42 +05:30
ritiek 54a9f33ba4 Add test for embedding metadata into .webm 2018-01-27 11:20:19 +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
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