#Playlist Curler Playlist Curler is a Python applicatioin that is capable of downloading songs from a given public YouTube playlist.
##Installation
The installation is really simple.
Just run, pip install -r requirements.txt
##Configuration
The only configuration place is in default_config.py. You can set DOWNLOAD_LOCATION
to any location you desire.
##Usage
Simply run, python playlistCurler.py --url 'YOUTUBE_URL'
Example:
python playlistCurler.py --url 'https://www.youtube.com/watch?v=lEKOWKcUxdU&list=PL9tY0BWXOZFtkcURIg7hkpWbpCBHCD5-G'
Note
: The YouTube URL needs to have list='PLAYLIST_ID'
in the query string.
##How It Works
Playlist Curler uses YouTube Data API V3 to retrieve videos' information from a given public YouTube playlist. The retrieved videos' information contains videoId
, title
, thumbnail
and channelId
.
Once we get all videos' information, the Playlist Curler constructs two different URLs for individual video: one is used to retrieve unique hash for the video from Youtube-mp3, and the other is used to download the video.
- Hash retrieving URL format:
- 'http://www.youtube-mp3.org/a/itemInfo/?video_id=%s&ac=www&t=grp&r=%s'
- First
%s
: videoId
- Second
%s
: timestamp in millisecond
- Download URL format:
- 'http://www.youtube-mp3.org/get?ab=128&video_id=%s&h=%s&r=%s.%s'
- First
%s
: videoId
- Second
%s
: hash retrieved from the first URL - Third
%s
: timestamp in millisecond - Fourth
%s
: some suffix generated with algorithm
The hash retrieving URL can be obtained from inspecting Network
tab of Chrome's Developer Tool.
The suffix generation funtion can be found in resources/downloadWorker.py. The function is retrieved from inspecting youtube-mp3.org's client side JavaScript file.
NOTE
: This application heavily relies on youtube-mp3's services. If youtube-mp3 decided to stop its service, this application might actually die XD.