youtube-dl

File download with reactjs doesn't work correctly (using axios)

早过忘川 提交于 2019-12-11 05:25:08
问题 I'm implementing a youtube video downloader using ytdl-core with Nodejs backend and Reactjs frontend. However, using ytdl-core library I'm able to send to youtube video file to frontend with this codeblock app.get('/download', (req, res) => { let { url, itag } = req.query; let id = ytdl.getURLVideoID(url); ytdl.getInfo(id, (err, info) => { if (err) { console.log(err); throw err; } else{ let audioandvideo = ytdl.filterFormats(info.formats, 'audioandvideo'); let video = audioandvideo.filter(obj

Python youtube-dl recompile

大城市里の小女人 提交于 2019-12-11 03:55:30
问题 The old youtube-dl use to be just one file so it was easy for me to edit. The new version has multiple files inside of it. To get it to work on my server I needed to extract the files and change the python path. Now how do I put it back together? The youtube-dl site says make compile. youtube-dl contains main .py, init .py, FileDownloader.py, InfoExtractors.py, PostProcessor.py, utils.py I need to put those scripts back into a single youtube-dl file. I'm running CentOS. Thanks for your help!

Change the output name when download with youtube-dl using python

做~自己de王妃 提交于 2019-12-10 18:19:35
问题 I tried to follow the tutorial to download a video from youtube: import youtube_dl ydl_opts = {} with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(['https://www.youtube.com/watch?v=Bdf-PSJpccM']) But i see only when using the command(in command line) with option -o we can change the output video name. So, how to add change output name option embedded in python script? I think it should be add to ydl_opts , but i don't know the syntax, can anybody help? 回答1: Try like this: import

youtube-dl python script postprocessing error: FFMPEG codecs aren't being recognized

风流意气都作罢 提交于 2019-12-10 18:19:09
问题 My python script is trying to download youtube videos with youtube-dl.py. Works fine unless postprocessing is required. The code: import youtube_dl options = { 'format':'bestaudio/best', 'extractaudio':True, 'audioformat':'mp3', 'outtmpl':'%(id)s', #name the file the ID of the video 'noplaylist':True, 'nocheckcertificate':True, 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '192', }] } with youtube_dl.YoutubeDL(options) as ydl: ydl.download([

Get video information from a list of playlist with youtube-dl

帅比萌擦擦* 提交于 2019-12-08 18:36:26
I'm tryng to get some informations from a list of playlists in youtube with youtube-dl. I've written this code but what it takes is not the video's informations but the playlist informations (e.g. the playlist title instead of the video title in the playlist). I can't understand why. input_file = open("url") for video in input_file: print(video) ydl_opts = { 'ignoreerrors': True } with youtube_dl.YoutubeDL(ydl_opts) as ydl: info_dict = ydl.extract_info(video, download=False) for i in info_dict: video_thumbnail = info_dict.get("thumbnail"), video_id = info_dict.get("id"), video_title = info

Reading in pydub AudioSegment from url. BytesIO returning “OSError [Errno 2] No such file or directory” on heroku only; fine on localhost

拈花ヽ惹草 提交于 2019-12-08 06:45:43
问题 EDIT 1 for anyone with the same error: installing ffmpeg did indeed solve that BytesIO error EDIT 1 for anyone still willing to help: my problem is now that when I AudioSegment.export("filename.mp3", format="mp3"), the file is made, but has size 0 bytes -- details below (as "EDIT 1") EDIT 2: All problems now solved. Files can be read in as AudioSegment using BytesIO I found buildpacks to ensure ffmpeg was installed correctly on my app, with lame support for exporting proper mp3 files Answer

Youtube-dl library and ERROR 403: Forbidden when using generated direct link by youtube-dl from different locations

这一生的挚爱 提交于 2019-12-08 03:06:07
问题 I have a problem with youtube-dl library (https://rg3.github.io/youtube-dl/). I use youtube-dl not for directly downloading videos by this library, instead I first generate link using command like this: youtube-dl --simulate --dump-json --prefer-ffmpeg -- -CmadmM5cOk I get needed format link from json answer, I use default format 1280x720 mp4. Links look like this "https://r4---sn-nto52nx-px8e.googlevideo.com/videoplayback?lmt=1432339993780507&ip=x.x.x.x&key=yt6&fexp=9408710%2C9409069

Reading in pydub AudioSegment from url. BytesIO returning “OSError [Errno 2] No such file or directory” on heroku only; fine on localhost

大憨熊 提交于 2019-12-06 15:55:22
EDIT 1 for anyone with the same error: installing ffmpeg did indeed solve that BytesIO error EDIT 1 for anyone still willing to help: my problem is now that when I AudioSegment.export("filename.mp3", format="mp3"), the file is made, but has size 0 bytes -- details below (as "EDIT 1") EDIT 2: All problems now solved. Files can be read in as AudioSegment using BytesIO I found buildpacks to ensure ffmpeg was installed correctly on my app, with lame support for exporting proper mp3 files Answer below Original question I have pydub working nicely locally to crop a particular mp3 file based on

Youtube-dl library and ERROR 403: Forbidden when using generated direct link by youtube-dl from different locations

不想你离开。 提交于 2019-12-06 10:55:53
I have a problem with youtube-dl library ( https://rg3.github.io/youtube-dl/ ). I use youtube-dl not for directly downloading videos by this library, instead I first generate link using command like this: youtube-dl --simulate --dump-json --prefer-ffmpeg -- -CmadmM5cOk I get needed format link from json answer, I use default format 1280x720 mp4. Links look like this " https://r4---sn-nto52nx-px8e.googlevideo.com/videoplayback?lmt=1432339993780507&ip=x.x.x.x&key=yt6&fexp=9408710%2C9409069%2C9413137%2C9415365%2C9415485%2C9416023%2C9416126%2C941 ...". Then I use this link to download video from

Node.JS downloading hundreds of files simultaneously

久未见 提交于 2019-12-05 15:32:55
I am trying to download more that 100 files at the same time. But when I execute the downloading function my macbook freezes(unable to execute new tasks) in windows also no download(but doesn't freeze) and no download progress in both case(idle network). Here is my download module: var express = require('express'); var router = express.Router(); var fs = require('fs'); var youtubedl = require('youtube-dl'); var links = require('../models/Links'); router.get('/', function (req, res, next) { links.find({dlStatus: false}, function (err, docs) { if (err) { console.log(err); res.end(); } else if (