youtube-dl

Discord Music bot VoiceClient' object has no attribute 'create_ytdl_player'

梦想的初衷 提交于 2020-08-19 10:44:11
问题 I wanted to programm my own discord bot, which plays some songs from youtube but it wont create the ydl player this is the error Command raised an exception: AttributeError: 'VoiceClient' object has no attribute 'create_ytdl_player' and this is my code. Thanks in advance. @client.command(pass_context=True) async def s(ctx): user=ctx.message.author voicech = ctx.author.voice.channel voice = await voicech.connect() player = await voice.create_ytdl_player("some url") player = await vc.create

youtube-dl only extract playlist info

送分小仙女□ 提交于 2020-08-04 23:19:02
问题 ydl = youtube_dl.YoutubeDL() with ydl: r = ydl.extract_info("myplaylist", download=False) # don't download, much faster print(r['uploader'],r['title'],r['thumbnail']) code output like this [youtube:playlist] Downloading playlist playlistidhere - add --no-playlist to just download video videoid [youtube:playlist] playlistidhere: Downloading webpage [download] Downloading playlist: playlistnamehere [youtube:playlist] playlist Spotlight On: June Recap: Downloading 39 videos [download]

how to set directory in ydl_opts in using youtube-dl in python?

烈酒焚心 提交于 2020-07-04 13:25:28
问题 ** What do i need to add to specify that all the download mp3 will go to this directory: e:/python/downloadedsongs ydl_opts = { 'format': 'bestaudio/best', 'download_archive': 'downloaded_songs.txt', 'outtmpl': '%(title)s.%(ext)s', 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '192', }], 'logger': MyLogger(), 'progress_hooks': [my_hook], } if i understand it correctly outtmpl is for the template of the name of output file. ** 回答1: outtmpl can