athlon1600 / youtube-downloader Goto Github PK
View Code? Open in Web Editor NEW:tv: PHP based alternative to youtube-dl and yt-dlp. Active and frequently updated! :star:
Home Page: https://unblockvideos.com/
License: MIT License
:tv: PHP based alternative to youtube-dl and yt-dlp. Active and frequently updated! :star:
Home Page: https://unblockvideos.com/
License: MIT License
is it possible to get all formats (video/audio , video only and audio only)?
i tried with a 4k video it doesnt seem to give the link
the link that is generated googlevideo.com/videoplayback?ratebypass comes..
What does it mean ? Like is there a max rate at which a video can be accessed and then it's streaming/downloading link wont come via cURL ?
Would appreciate more info on this
Thanks
Apparently Youtube updated the itag codes, itags provided in the parser class are not working
Hello,
First, thanks for the script. It's very good!
I have a question ... How do I get the 1080p and 480p links?
When I try to extract them only appears 720p and 360p.
Thank you.
Ps: A suggestion ... The script could have an option to download directly, not playing the video in the browser.
Before this upgrade you could stream the video, why did you delete it?
Hi.i run this project but some download url is not work
example youtube id "tzi6tkCbHBc";
get download ur: "https://r3---sn-aigl6ney.googlevideo.com/videoplayback?expire=1589764766&ei=PY7BXr_iOOaOxN8P4_uK2Ao&ip=64.227.40.195&id=o-AMBaUnaG5QHVgity_wOr56dfF-0Y2KMxzq0Aoc9dEY82&itag=18&source=youtube&requiressl=yes&mh=pI&mm=31%2C29&mn=sn-aigl6ney%2Csn-aigzrney&ms=au%2Crdu&mv=m&mvi=2&pl=21&gcr=gb&initcwndbps=162500&vprv=1&mime=video%2Fmp4&gir=yes&clen=12803988&ratebypass=yes&dur=184.575&lmt=1587863251161273&mt=1589743056&fvip=6&c=WEB&txp=5431432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cgcr%2Cvprv%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAN2ZdmVBWsUFjlC_M7mE55sZ_L-zLD2_jRAdf564M-eFAiBvFkh7A4_WALs3gds1R5nZQtrQkTbYCpZePIg1gLa-iA%3D%3D&sig=AOq0QJ8wRQIgHdg1J2s2rZ6Mvvw9BYouvls_hUOCBRNq5kKdfMjY22QCIQCx1xgFfRLeZsbQAUdG4D0M0gvEMF2-C2tvIc1K4VNrPA=="
i test this project in localhost.its ok.but in server is not work.(domain have ssl sertificate)
how can fix this problem?
php version :7.1.33
composer version:1.10.6
The video urls return 403 forbidden
I got 403 FORBIDDEN when accessing a copyright/protected youtube video :(
You can try experimenting some videos in my website:
this will run perfectly fine (no copyrighted):
https://tirtagt.xyz/downloader/YTDL/index.php?id=bcsU1paVmMM
but this will got the forbidden message (copyrighted videos) :
https://tirtagt.xyz/downloader/YTDL/index.php?id=5HwEy5ue9nY
Did someone got a solution????
The demo links are not working.
Here is one of them: https://api.unblockvideos.com/youtube_downloader?id=e-ORhEE9VVg&selector=mp4
Change
$player_url = str_replace('//', 'http://', $matches[1]);
to
$player_url = str_replace('//', 'https://', $matches[1]);
The third Demo link (Works with Age-Restricted videos too:
) in the Readme throws this error:
Undefined variable: result in YouTubeDownloader.php line 443
This link:
https://api.unblockvideos.com/youtube_downloader?id=dUiuuoCAMuw&selector=mp4&redirect=true
I'm looking for videos with format "mp4, 1080p, video/audio" or "mp4, 720p, video/audio".
But the links returned for the videos I've tried (movie trailers) mostly have a format that's either video or audio or unknown.
Is there a way to download the best quality mp4 version available with video and audio?
All the videos I've tried have 1080p streams with sound on youtube.com
Currently getDownloadLinks gives a link which when opened, plays the video. Is there a way to just get a link to the .mp4 file for downloading?
Video formats (1080, 4K, etc...) above 720p are not available for some reason.
Hi , if you are true coder then just try to find ciphered video download link should work
for example try this video link it wont able to download shows you 404 Error
https://api.unblockvideos.com/youtube_downloader?id=QQ4Gds8phUk&selector=mp4
So better try to find decryption function to download all videos like that i mentioned above and already youtube-dl software using this decryption of ciphered videos so try your best
Will it be possible to update the parseItagInfo()
using the mime parsing methods used in this file ?
for this video https://api.unblockvideos.com/youtube_downloader?id=https://www.youtube.com/watch?v=STv1I1iu5y8 it shows me could not parse links. why?
its only get a single video file mp4 360p in video/audio format rest are only video no audio
Because it doesn't tell where i should to get started, i searched on all folders and find index.html on public folder's.
I was quite happy when i load the index.html on my web browser, because it looks the same as the DEMO URL : https://youtube-downloader3.herokuapp.com/
But, when i'm pasting the YouTube links on the text button provided and pressing fetch.
This bad errors pops up : `PHP Warning: require(../vendor/autoload.php): failed to open stream: No such file or directory in htdocs\Athlon\public\video_info.php on line 3.
PHP Fatal error: require(): Failed opening required '../vendor/autoload.php'
So i was guessing ah i need to find those autoload.php thingies, but cant find any where on the zip that i downloaded from here :/ tried searching on all src/,tests/,public/ but No luck.
Hello, recently it can't generate signiture correctly for some videos!
how to install ?
Hi,
I love this youtube-downloader, but I'm not able to make it work like https://api.unblockvideos.com/youtube_downloader
Can you help?
Thank You :D
It's working fine just one month, but now it's not work for me,
but you https://api.unblockvideos.com/youtube_downloader?id=nxmp6eb_QgI worked fine
can you give an any update?
Hello, i just wanted to know if you can help me install that on my server, i have treid everything installing but it just wont show. can you please please tell me how i can install that on my vps. i have centos 6
I'm wanting only the audio from youtube videos. Is this something you would consider adding to the class? If not, where would I start when trying to change something like this?
Great work by the way; youtube-dl takes upwards of 4 seconds for me and what you've made takes at most 0.3 seconds. Incredible! Plus youtube-dl seems to fail every couple of weeks and require an update to get it back in working order so the downtime really sucks! Mad props
First Thank you for your awesome contribution, have made a test site youtube37 . com which is performing very well now. But now as I have continuously gaining users so every week my IP blocked. do you have any solution for that ? also can you recommended a cheap hosting with ffmpeg support and support to add custom IP as well. currently using dreamhost's shared hosting.
Thanks once again.
You can download age-gated videos too.
// age-gate
if(strpos($html, 'player-age-gate-content') !== false){
// nothing you can do folks...
return false;
}
There are 2 type age-gated videos:
1. Regular age-gate video
Download process looks like this:
sts
id from https://www.youtube.com/embed/HtVdAasjOgU (sts
is 17184)url_encoded_fmt_stream_map
2. Age-gate video with encrypted signature
Similar like in first case but you need decrypt signature after step 3.
Demo video: https://www.youtube.com/watch?v=6kLq3WMV1nU
Hi,
just tested the script and links for this video work on localhost and dcannot be opened when script runs from remote server https://www.youtube.com/watch?v=GWKtoSza8lM
Been using the class for a while and i'm loving it! Noticed a few urls aren't working as expected though e.g https://www.youtube.com/watch?v=weeI1G46q0o
could it be because it's vevo? I checked and it's not age restricted - I'm guessing something to do with the signature
Title says it all..
Please let me know.
Thanks.
Vevo video download not working.Any one facing?
Awesome script...
Is there a way to fetch the title of the video and give an option of:
save as: 'source video title.mp4'
can the script handle downloads in mp3 out of the box?
Hi, congrats to your fist issue.
Demo video doesn't work https://www.youtube.com/watch?v=QxsmWxxouIM. I cannot open grabbed links.
More about encrypted signatures
https://www.quora.com/How-can-I-make-a-YouTube-video-downloader-web-application-from-scratch
hey Athlon1600,
i'm using your lib for a Telegram bot and i just realized that.
and now as i'm testing it and for making sure using your example
i mean this :
use YouTube\YouTubeDownloader;
$yt = new YouTubeDownloader();
$links = $yt->getDownloadLinks("https://www.youtube.com/watch?v=LJzCYSdrHMI");
var_dump($links);
it returns an empty array :
array(0) { }
Thanks in advance. 👍
With the public function parsePlayerResponse you have to put in $js_code as second parameter. How to determine what value to put for $js_code?
Hello,
My steps with clear Debian 10
apt update && apt -y upgrade
apt -y install php php-common
apt -y install php-cli php-fpm php-json php-pdo php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath
apt -y install libapache2-mod-php
systemctl restart apache2
apt install curl php-cli php-mbstring git unzip
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
cd /var/www/html
composer require athlon1600/youtube-downloader
(/var/www/html/youtube.php):
require 'var/www/html/vendor/autoload.php';
use YouTube\YouTubeDownloader;
$yt = new YouTubeDownloader();
$links = $yt->getDownloadLinks("https://www.youtube.com/watch?v=QxsmWxxouIM");
var_dump($links);
And it's show array(0) { }
What did I do wrong?
The Demo API and the code are working but when I try to access the video ressources given, googlevideo.com responds with either a 403 Forbidden Error or a blank page.
I tried to access the ressource with Chrome, Firefox and a different IP with the Tor Browser.
All test weren't successful. Maybe YouTube changed something in their code. When I access the Demo Stream Version it redirects me to redirector.googlevideo.com instead of https://---.googlevideo.com/videoplayback?...
some videos like vevo videos can't be downloaded it return 403.
demo: https://api.unblockvideos.com/youtube_downloader?id=https://www.youtube.com/watch?v=fyaI4-5849w
This error:
file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14095126:SSL routines:ssl3_read_n:unexpected eof while reading
returns when:
$file = file_get_contents($url['url'], false, stream_context_create($arrContextOptions));
https://www.youtube.com/watch?v=r5NzAksjfDI
$video_id = $yt->extractVideoId(implode($url));
$links = $yt->getDownloadLinks($video_id, $selector = 'video');
$arrayindex = array_search('mp4, video, 1080p, audio', array_column($links, 'format'));
$url = $links[$arrayindex];
$arrContextOptions=array( "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ), );
$video = file_get_contents($url['url'], false, stream_context_create($arrContextOptions));
return view('convert', [ 'url' => $url['url'], 'quality' => $url['format'], ]);
Expected behavior:
The video gets downloaded on my disk
Actual behavior:
I get this error:
file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14095126:SSL routines:ssl3_read_n:unexpected eof while reading
The code stops executing on that line aswell.
The latest version of:
https://github.com/Athlon1600/youtube-downloader
I'm running this on Laravel 7, with php artisan serve.
Hey!
Any chance you can update the script with latest YT changes?
For example the video with this id: 3KiRiNyWVV4
Cannot be downloaded.
Thanks
Hello all links to videos don't have any sound only 360p and audio but 1080p or 720p or 480p don't have a sound try https://yt-ar.herokuapp.com/video_info.php?url=http://www.youtube.com/watch?v=poIhZfFAZ3o
how to get youtube original title?
SOLVE WITH EXISTING FUNCTION
require_once(plugin_dir_path(__FILE__).'vendor/autoload.php');
$yt = new YouTubeDownloader();
$links = $yt->getDownloadLinks($_POST['youtubeLink']);
$youtube_id = $yt->extractId($_POST['youtubeLink']);
$restriction = $yt->curl('https://api.unblockvideos.com/youtube_restrictions?id='.$youtube_id);
var_dump(json_decode($restriction)[0]->title);exit;
hello
when i click on download video button videos opening not downloading
Hi, am new to these stuffs, from medical background; i want to know how i can use this in my view or give it a UI and target each properties e.g $links->title, $links->duration and loop through the extensions format, just a guild please. i know it may sound foolish but anything you can do to help thanks
I get
Access to r4---sn-gqn-jawe.googlevideo.com was denied You don't have authorization to view this page. HTTP ERROR 403
Also i tried with file_get_contents, or file_put_contents to see if i must to use same ip, but nothing...
I saw at (savefrom . net) using same thing but every time on request there IP have changed e.g.
what kind of technologies they are using ?
this script is no longer work in production environment due to error 421 to many request so can we use proxy to hide server's original ip from blocked
Hey, I tried updated version but on some videos it return empty array of links. It's missing "url_encoded_fmt_stream_map" is there any way to fix this?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.