Skip to content

Instantly share code, notes, and snippets.

@bennyyip
Last active May 2, 2021 04:39
Show Gist options
  • Select an option

  • Save bennyyip/1c47ae56c2bd56b2f68e66e63ae7307c to your computer and use it in GitHub Desktop.

Select an option

Save bennyyip/1c47ae56c2bd56b2f68e66e63ae7307c to your computer and use it in GitHub Desktop.
streetvoice mp3 downlaod (need ffmpeg)
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