Last active
October 7, 2015 00:58
-
-
Save vshivam/3080345 to your computer and use it in GitHub Desktop.
Download songs from songs.pk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib | |
| import re | |
| def songspk(movie_name): | |
| movie_name = "_".join(movie_name.split()) | |
| print movie_name | |
| first_char = movie_name[0:1] | |
| movie_list_url = "http://www.songspk.name/" + first_char.lower()+"_list.html" | |
| print movie_list_url | |
| source = urllib.urlopen(movie_list_url).read() | |
| reg = movie_name.lower()+".*.html" | |
| print reg | |
| regex = re.compile(reg) | |
| list = regex.findall(source) | |
| print list | |
| movie_page_source = urllib.urlopen("http://songspk.name/"+list[0]).read() | |
| reg_song_name = "http://link[0-9]*\.songspk\.name/song[0-9]*\.php\?songid=[0-9]*" | |
| regex_2 = re.compile(reg_song_name) | |
| list_2 = regex_2.findall(movie_page_source) | |
| print list_2 | |
| count=2 | |
| for i in list_2: | |
| urllib.urlretrieve(i, "/home/shivam/songs/song_"+str(count)+".mp3") | |
| count=count+1 | |
| songspk("hum dil de") |
Author
vshivam
commented
Jul 10, 2012
- Songs are by default saved in the C Drive
- Movie names should be correct even if incomplete. Eg : Hum Dil De will suffice for Hum Dil De Chuke Sanam
- Downloading depends on your Internet Speed !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment