Last active
May 2, 2021 04:39
-
-
Save bennyyip/1c47ae56c2bd56b2f68e66e63ae7307c to your computer and use it in GitHub Desktop.
streetvoice mp3 downlaod (need ffmpeg)
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 youtube_dl | |
| writethumbnail = True | |
| postprocessors = [] | |
| postprocessors.append({"key": "FFmpegMetadata"}) | |
| postprocessors.append( | |
| {"key": "EmbedThumbnail", "already_have_thumbnail": writethumbnail} | |
| ) | |
| ydl_opts = { | |
| "outtmpl": "%(uploader)s/%(track)s.%(ext)s", | |
| "writethumbnail": writethumbnail, | |
| "format": "bestaudio/best", | |
| "postprocessors": postprocessors, | |
| "proxy": "socks5://127.0.0.1:1080", | |
| } | |
| urls = [] | |
| # https://streetvoice.com/hsienchinnng/songs/ | |
| # Array.from(document.querySelectorAll('div.col-sm-4 > div:nth-child(1) > div:nth-child(1) > button:nth-child(1)')).map(x=>x.dataset['id']) | |
| songids = ["637467", "627643", "622036", "609546", "602466", "596969", "591702", "589085", "581182"] | |
| url = "https://streetvoice.com/collage7275/songs/{songid}/" | |
| urls += [url.format(songid=x) for x in songids] | |
| songids = ["610833", "595187", "581509", "570924", "566421"] | |
| url = "https://streetvoice.com/hsienchinnng/songs/{songid}/" | |
| urls += [url.format(songid=x) for x in songids] | |
| with youtube_dl.YoutubeDL(ydl_opts) as ydl: | |
| ydl.download(urls) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment