youtube-dl

How to format output video/audio name with youtube-dl embed?

How to format output video/audio name with youtube-dl embed? Question: I’m writing a python script that downloads videos from a URL using youtube-dl. Here’s the code: def downloadVideos(videoURL): ydl_opts = { ‘format’: ‘bestvideo,bestaudio’, } with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([videoURL]) The above method downloads an mp4 file for the video and a m4a file for the …

Total answers: 3

pytube: AttributeError: 'NoneType' object has no attribute 'span' cipher.py

pytube: AttributeError: 'NoneType' object has no attribute 'span' cipher.py Question: Yesterday this works fine, today i’m getting error on my local machine, colab notebook, even on my VPS. /usr/local/lib/python3.9/dist-packages/pytube/cipher.py in get_throttling_plan(js) 409 match = plan_regex.search(raw_code) 410 –> 411 transform_plan_raw = find_object_from_startpoint(raw_code, match.span()[1] – 1) 412 413 # Steps are either c[x](c[y]) or c[x](c[y],c[z]) from pytube …

Total answers: 1

Error: Unable to extract uploader id – Youtube, Discord.py

Error: Unable to extract uploader id – Youtube, Discord.py Question: I have a veary powerfull bot in discord (discord.py, PYTHON) and it can play music in voice channels. It gets the music from youtube (youtube_dl). It worked perfectly before but now it dosn’t wanna work with any video. I tried updataing youtube_dl but it still …

Total answers: 9

youtube-dl :: how to listen to audio while downloading

youtube-dl :: how to listen to audio while downloading Question: I know that I can download an audio track from YouTube through this easy command: youtube-dl -f 251 ‘http://www.youtube.com/watch?v=HRIF4_WzU1w’ Lately YouTube has been slowing down the download speed. Is there a way I can listen to the audio while downloading the track? Where is the …

Total answers: 1

Python & YoutubeDL, retrive info-json, modify it and work with it

Python & YoutubeDL, retrive info-json, modify it and work with it Question: I need to work with only a part of the info-json that youtubedl obtains: the problem is in a video platform where, in the browser, you can watch the video or download/hear the audio file (that is besides the internal audio files from …

Total answers: 2

Python youtube_dl does not allow to download age-restricted videos

Python youtube_dl does not allow to download age-restricted videos Question: I have this following code: from youtube_dl import YoutubeDL videos = […] with YoutubeDL() as ydl: ydl.download(videos) And this is the error: WARNING: unable to download video info webpage: HTTP Error 410: Gone ERROR: Sign in to confirm your age This video may be inappropriate …

Total answers: 1

Can I use yt-dlp to extract only one video info from a playlist?

Can I use yt-dlp to extract only one video info from a playlist? Question: Here’s my code using Python (simplified version): import yt_dlp YDL_OPTIONS = { ‘format’: ‘bestaudio*’, ‘noplaylist’: True, } with yt_dlp.YoutubeDL(YDL_OPTIONS) as ydl: info = ydl.extract_info(url, download=False) The problem comes up when the url directs to a playlist (e.g. https://www.youtube.com/playlist?list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb) Here’s the output: …

Total answers: 1

Porting code from youtube-dl to yt-dlp library for Python Discord Bot

Porting code from youtube-dl to yt-dlp library for Python Discord Bot Question: This is my first question here therefore I hope this format is fine. I’ve searched for the issue on internet and checked the documentation of yt-dlp however could not find something useful or maybe I just dont understand what to do. In a …

Total answers: 2

Python buffered IO ending early streaming with multiple pipes

Python buffered IO ending early streaming with multiple pipes Question: I’m trying to make a continuous livestream of videos downloaded via yt-dlp. I need to port this (working) bash command into Python. ( youtube-dl -v –buffer-size 16k https://youtube.com/watch?v=QiInzFHIDp4 -o – | ffmpeg -i – -f mpegts -c copy – ; youtube-dl -v –buffer-size 16k https://youtube.com/watch?v=QiInzFHIDp4 …

Total answers: 1