Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Coding Releases
You last visited: Today at 01:07

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Perl] Youtube playlist ripper

Discussion on [Perl] Youtube playlist ripper within the Coding Releases forum part of the Coders Den category.

Reply
 
Old   #1
 
f00lish's Avatar
 
elite*gold: 0
Join Date: Oct 2013
Posts: 91
Received Thanks: 539
[Perl] Youtube playlist ripper

Youtube Playlist Ripper

This is probably something easy to create but you dont find it easily on the web.
I always wanted to download playlists from youtube cause I have slow internet connection and when I play pvps I get lag. So.. I decided to create something to help me and share it with you, cause you might have same problem and if you like it , improve the script for more.

Its written in perl so you will need to download perl if you plan to run it on windows.


PHP Code:

#!perl
eval unpack u=>q{_=7-E('-T<FEC=#L*=7-E('=A<FYI;F=S.PIU<V4@0W=D.PIU<V4@5U=7.CI9;W54=6)E.CI$;W=N;&]A9#L*_=7-E($Q74#HZ57-E<D%G96YT.PIP<FEN="`B7'1Y;W5T=6)E('!L87EL:7-T(')I<'!E<B`O(&8P,&QI<V@@?7$!E;&ET97!V<&5R<UQN(CL*8VQO<V4@4U1$15)2.P};

open FH"<playlist.txt" || die $!;
my $lista = <FH>;
$lista =~ s/\n//g;
my $saf LWP::UserAgent->new();
my $data $saf->get($lista);
my $html $data->content;
my $path getcwd;
$path =~ s/\//\\/g;
$path .= '\\';
mkdir($ARGV[0]);
my $c;
if (
$html =~ /watch7-playlist-length">(\d*)</gs) {
    
$c = $1;
}

for (1..
$c) {
    if(
$html =~ /data-video-id="(.*?)"/gs) {
        eval { ytdownload($1,
$_) }
    }
}

sub ytdownload {
    my 
$client = WWW::YouTube::Download->new;
    my 
$title = $client->get_title($_[0]);
    
    print sprintf ("
%02d:%02d:%02d",reverse((localtime(time))[0..2])).":GET:::[$_[1]/$c$title\n";
    
$client->download($_[0],{
        fmt      => 
$client->get_fmt($_[0]),
        filename => 
$ARGV[0]."\\".$title.'.'.$client->get_suffix($_[0])  
        } 
    ) if ! -e 
$ARGV[0]."\\".$client->get_title($_[0]).'.'.$client->get_suffix($_[0]);
    #vid2mp3(
$path.$ARGV[0]."\\".$client->get_title($_[0]).'.'.$client->get_suffix($_[0]),$path.$ARGV[0]."\\".$client->get_title($_[0]).'.mp3')

Usage
  • Save the source code in a perl file such as playlist.pl
  • Run cmd.exe and navigate to the file path
  • Create a text file playlist.txt open and type the playlist link you want to download
  • run the script using: perl playlist.pl music (music is the folder we save the music)


The script is in a very basic step so improvements are to come!


Attached Images
File Type: jpg playlist.JPG (28.1 KB, 31 views)
f00lish is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Komplette Youtube Playlist downloaden
04/01/2013 - Tutorials - 12 Replies
Hey, Ich will euch hier mal zeigen wie ihr mit dem JDownloader komplette Youtube Playlists aufeinmal downloaden könnt ;). Die Playlist in youtube öffnen. Den Link der Youtube Playlist finden. Ich nehme mal diese hier als Beispiel: http://www.youtube.com/watch?v=OE7q2I6JLJ8&pla ynext=1&list=PL88014E81E4AB7F6A
Suche Youtube Playlist!
12/01/2012 - elite*gold Trading - 2 Replies
Suche eine Playlist mit so 20 Liedern mit Mixen von DnB und Dubstep. Es soll schonmal keine kack mit Gesang oder sowas..! Wenn sie mir Gefällt gebe ich dem jenigen 20 Egold. Die Mixe sollen mindestens 10 Minuten gehen.
Youtube Playlist downloaden?
10/17/2012 - Off Topic - 3 Replies
Habt ihr einen weg um eine ganze Playlist zu downloaden ;;; Mit JDownloader ist es atm nicht möglich.
[NEU]Like|Dislike|Abo|Kommi|Favo|Playlist|Youtube Service *Billig [NEU]
11/04/2011 - elite*gold Trading - 6 Replies
http://s14.directupload.net/images/111030/3wvyk2hl .png Hallo Epvp User. Ich eröffne jetzt mein ersten Youtube Store und hoffe,dass es gut läuft =) http://s7.directupload.net/images/111030/u2l7ovw3 .png Ich biete an : ►Like ►Dislike
Neues Youtube Design - Playlist Random
04/01/2010 - Off Topic - 0 Replies
Mit dem neuen Design scheint es keinen Button mehr für "nächstes Video in der Playlist" und auch keinen für "Zufällige Wiedergabe" zu geben, oder hat jmd diese Funktionen schon gefunden ?



All times are GMT +1. The time now is 01:07.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.