🐪 convert.pl (Perl) 4.1 KB 2016-12-11
Perl module for convert
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | #!/usr/bin/perl
###########################
### Autor: Sebastian Enger / B.Sc.
### Copyright: Sebastian Enger
### Licence: BSD
### Version: 1.1.b - 20080716@19.Uhr
### Contact: sebastian.enger@gmail.com | icq: 135846444
### Latest Version: PENDRIVE:\Programming\Perl\IncrementalBackup
###########################
# http://search.cpan.org/~xaicron/WWW-YouTube-Download/lib/WWW/YouTube/Download.pm
## http://search.cpan.org/~mizzy/FFmpeg-Command-0.07/lib/FFmpeg/Command.pm
use WWW::YouTube::Download; # perl -MCPAN -e 'force install "WWW::YouTube::Download"'
#use List::Util qw(min);
#use Data::Dumper;
use Getopt::Long;
use DBI;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use FFmpeg::Command; # perl -MCPAN -e 'force install "FFmpeg::Command"'
GetOptions ("video_id=s" => \$video_id) or die("Error in command line arguments\n");
my $store_path = "/home/www/mp3/store";
my $tmp_path = "/home/www/mp3/tmp";
my $ffmpeg_bin = "/usr/local/bin/ffmpeg";
my $ffmpeg = FFmpeg::Command->new($ffmpeg_bin);
my $dbh = DBI->connect("dbi:mysql:dbname=youtube","root","rouTer99", {
AutoCommit => 1,#0=$dbh->commit();
RaiseError => 1,
});
print "PREPARE QUERY \n";
# PREPARE THE QUERY
my $query = "SELECT video_url,video_author,video_title,video_category FROM converter WHERE mp3_ready='0' AND video_id='$video_id' LIMIT 1;";
my $query_handle = $dbh->prepare($query);
#open(W,"+>>out.txt");
# print W "$query";
#close W;
# EXECUTE THE QUERY
$query_handle->execute();
# BIND TABLE COLUMNS TO VARIABLES
$query_handle->bind_columns(\$video_url,\$video_author,\$video_title,\$video_category);
print "LOOP THROUGH RESULTS \n";
# LOOP THROUGH RESULTS
... [truncated, 62 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "convert.pl",
"description": "Perl module for convert",
"dateModified": "2016-12-11",
"dateCreated": "2025-03-23",
"contentSize": "4.1 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/convert.pl",
"encodingFormat": "text/x-perl",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Perl"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/"
}
🐍 convert.py (Python) 2.7 KB 2016-12-11
Python module for convert
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | from pytube import YouTube
# not necessary, just for demo purposes
from pprint import pprint
yt = YouTube()
# Set the video URL.
yt.url = "http://www.youtube.com/watch?v=ZBHWAY7-cwg"
# Once set, you can see all the codec and quality options YouTube has made
# available for the perticular video by printing videos.
pprint(yt.videos)
#[<Video: MPEG-4 Visual (.3gp) - 144p>,
# <Video: MPEG-4 Visual (.3gp) - 240p>,
# <Video: Sorenson H.263 (.flv) - 240p>,
# <Video: H.264 (.flv) - 360p>,
# <Video: H.264 (.flv) - 480p>,
# <Video: H.264 (.mp4) - 360p>,
# <Video: H.264 (.mp4) - 720p>,
# <Video: VP8 (.webm) - 360p>,
# <Video: VP8 (.webm) - 480p>]
# The filename is automatically generated based on the video title.
# You can override this by manually setting the filename.
# view the auto generated filename:
print yt.filename
#Pulp Fiction - Dancing Scene [HD]
# set the filename:
#yt.filename = 'Dancing Scene from Pulp Fiction'
# You can also filter the criteria by filetype.
#pprint(yt.filter('flv'))
#[<Video: Sorenson H.263 (.flv) - 240p>,
# <Video: H.264 (.flv) - 360p>,
# <Video: H.264 (.flv) - 480p>]
# notice that the list is ordered by lowest resolution to highest. If you
# wanted the highest resolution available for a specific file type, you
# can simply do:
#print yt.filter('mp4')[-1]
#<Video: H.264 (.mp4) - 720p>
# you can also get all videos for a given resolution
... [truncated, 43 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "convert.py",
"description": "Python module for convert",
"dateModified": "2016-12-11",
"dateCreated": "2025-03-23",
"contentSize": "2.7 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/convert.py",
"encodingFormat": "application/x-python",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Python"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/"
}
🐪 convertV3.pl (Perl) 3.2 KB 2016-12-11
Perl module for convertV3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | #!/usr/bin/perl
#print "\033[2J"; #clear the screen
#print "\033[0;0H"; #jump to 0,0
###########################
### Autor: Sebastian Enger / B.Sc.
### Copyright: Sebastian Enger
### Licence: BSD
### Version: 1.1 - 28-10-2013@16.20.Uhr
### Contact: sebastian.enger@gmail.com | icq: 135846444
### Latest Version: PENDRIVE:\Programming\Perl\IncrementalBackup
###########################
## http://search.cpan.org/~mizzy/FFmpeg-Command-0.07/lib/FFmpeg/Command.pm
#use List::Util qw(min);
#use Data::Dumper;
use Getopt::Long;
no strict "refs";
use DBI;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use FFmpeg::Command; # perl -MCPAN -e 'force install "FFmpeg::Command"'
GetOptions ("video_url=s" => \$video_url) or die("Error in command line arguments\n");
my $store_path = "/home/wwwyoutube/storeMP3save2014";
my $tmp_path = "/home/wwwyoutube/tmp"; # change in python script too
my $ffmpeg_bin = "/usr/local/bin/ffmpeg";
my $python = "/usr/bin/python";
my $python_script = "/home/wwwyoutube/exec/convert_simple.py";
my $error = "";
my $query_update = "";
my $dbh = DBI->connect("dbi:mysql:dbname=youtube","root","rouTer99", {
AutoCommit => 1,#0=$dbh->commit();
RaiseError => 1,
});
# LOOP THROUGH RESULTS
my $mp3_id = md5_hex($video_url.$$.$client.$query.$dbh.$title.$fmt.$hash.rand(8094).rand(8094));
my @args = ("$python", "$python_script", "$video_url", "$mp3_id");
my $returnCodeDownload = system(@args);# == 0 or warn "system @args failed: $?"; # later give back error occurred
#print "@args --> returnCodeDownload=$returnCodeDownload\n\n"; exit;
if ($returnCodeDownload != 0) {
$error = "E100: Video could not be downloaded."; # PyTube PRoxy Support einbauen
$query_update = "UPDATE converter SET mp3_ready = '0', mp3_error = '$error' WHERE video_url = '$video_url';";
eval { $dbh->do($query_update) };
exit(1);
}
... [truncated, 33 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "convertV3.pl",
"description": "Perl module for convertV3",
"dateModified": "2016-12-11",
"dateCreated": "2025-03-23",
"contentSize": "3.2 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/convertV3.pl",
"encodingFormat": "text/x-perl",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Perl"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/"
}
🐍 convert_simple.py (Python) 700 bytes 2016-12-11
Python module for convert simple
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 | #!/usr/bin/python
from pytube import YouTube
import sys
#print ("First argument: %s" % str(sys.argv[1]))
#print ("Second argument: %s" % str(sys.argv[2]))
#sys.exit(0)
videofile = str(sys.argv[1])
md5id = str(sys.argv[2])
yt = YouTube()
# Set the video URL.
yt.url = videofile
#"http://www.youtube.com/watch?v=ZBHWAY7-cwg"
# view the auto generated filename:
#print yt.filename
yt.filename = md5id;
#video = yt.get('mp4', '720p')
video = yt.get('mp4')
# Okay, let's download it!
#video.download()
# Note: If you wanted to choose the output directory, simply pass it as an
# argument to the download method.
video.download('/home/wwwyoutube/tmp/')
sys.exit(0)
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "convert_simple.py",
"description": "Python module for convert simple",
"dateModified": "2016-12-11",
"dateCreated": "2025-03-23",
"contentSize": "700 bytes",
"contentUrl": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/convert_simple.py",
"encodingFormat": "application/x-python",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Python"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/"
}
🐪 convertv2.pl (Perl) 3.2 KB 2016-12-11
Perl module for convertv2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | #!/usr/bin/perl
print "\033[2J"; #clear the screen
print "\033[0;0H"; #jump to 0,0
###########################
### Autor: Sebastian Enger / B.Sc.
### Copyright: Sebastian Enger
### Licence: BSD
### Version: 1.1 - 28-10-2013@16.20.Uhr
### Contact: sebastian.enger@gmail.com | icq: 135846444
### Latest Version: PENDRIVE:\Programming\Perl\IncrementalBackup
###########################
## http://search.cpan.org/~mizzy/FFmpeg-Command-0.07/lib/FFmpeg/Command.pm
#use List::Util qw(min);
#use Data::Dumper;
use Getopt::Long;
no strict "refs";
use DBI;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use FFmpeg::Command; # perl -MCPAN -e 'force install "FFmpeg::Command"'
GetOptions ("video_url=s" => \$video_url) or die("Error in command line arguments\n");
my $store_path = "/home/www/mp3/store";
my $tmp_path = "/home/www/mp3/tmp";
my $ffmpeg_bin = "/usr/local/bin/ffmpeg";
my $python = "/usr/bin/python";
my $python_script = "/home/www/mp3/exec/convert_simple.py";
my $error = "";
my $query_update = "";
my $ffmpeg = FFmpeg::Command->new($ffmpeg_bin);
my $dbh = DBI->connect("dbi:mysql:dbname=youtube","root","rouTer99", {
AutoCommit => 1,#0=$dbh->commit();
RaiseError => 1,
});
# LOOP THROUGH RESULTS
my $mp3_id = md5_hex($video_url.$$.$client.$query.$dbh.$title.$fmt.$hash.rand(8094).rand(8094));
my @args = ("$python", "$python_script", "$video_url", "$mp3_id");
my $returnCodeDownload = system(@args);# == 0 or warn "system @args failed: $?"; # later give back error occurred
if ($returnCodeDownload != 0) {
$error = "E100: Video could not be downloaded."; # PyTube PRoxy Support einbauen
$query_update = "UPDATE converter SET mp3_ready = '0', mp3_error = '$error' WHERE video_url = '$video_url';";
eval { $dbh->do($query_update) };
exit(1);
}
... [truncated, 33 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "convertv2.pl",
"description": "Perl module for convertv2",
"dateModified": "2016-12-11",
"dateCreated": "2025-03-23",
"contentSize": "3.2 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/convertv2.pl",
"encodingFormat": "text/x-perl",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Perl"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/"
}
📄 new 6.txt (Text) 78 bytes 2016-12-11
Source code file for new 6
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "new 6.txt",
"description": "Source code file for new 6",
"dateModified": "2016-12-11",
"dateCreated": "2025-03-23",
"contentSize": "78 bytes",
"contentUrl": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/new 6.txt",
"encodingFormat": "text/plain",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Text"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/"
}
📄 out.txt (Text) 161 bytes 2016-12-11
Source code file for out
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "out.txt",
"description": "Source code file for out",
"dateModified": "2016-12-11",
"dateCreated": "2025-03-23",
"contentSize": "161 bytes",
"contentUrl": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/out.txt",
"encodingFormat": "text/plain",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Text"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/"
}
🐪 youtubedown.pl (Perl) 71.3 KB 2016-12-11
Perl module for youtubedown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | #!/usr/bin/perl -w
# Copyright © 2007-2013 Jamie Zawinski <jwz@jwz.org>
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation. No representations are made about the suitability of this
# software for any purpose. It is provided "as is" without express or
# implied warranty.
#
# Given a YouTube or Vimeo URL, downloads the corresponding MP4 file.
# The name of the file will be derived from the title of the video.
#
# --title "STRING" Use this as the title instead.
# --progress Show a textual progress bar for downloads.
# --suffix Append the video ID to each written file name.
# --size Instead of downloading it all, print video dimensions.
# This requires "mplayer" and/or "ffmpeg".
#
# For playlists, it will download each video to its own file.
#
# You can also use this as a bookmarklet: put it somewhere on your web server
# as a .cgi, then bookmark this URL:
#
# javascript:location='http://YOUR_SITE/youtubedown.cgi?url='+location
#
# or, the same thing but using a small popup window,
#
# javascript:window.open('http://YOUR_SITE/youtubedown.cgi?url='+location.toString().replace(/%26/g,'%2526').replace(/%23/g,'%2523'),'youtubedown','width=400,height=50,top=0,left='+((screen.width-400)/2))
#
#
# When you click on that bookmarklet in your toolbar, it will give you
# a link on which you can do "Save Link As..." and be offered a sensible
# file name by default.
#
# Make sure you host that script on your *local machine*, because the entire
# video content will be proxied through the server hosting the CGI, and you
# don't want to effectively download everything twice.
#
# Created: 25-Apr-2007.
require 5;
use diagnostics;
use strict;
use Socket;
my $progname0 = $0;
my $progname = $0; $progname =~ s@.*/@@g;
my $version = q{ $Revision: 1.237 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/;
... [truncated, 2151 more lines] ...
|
{
"@context": "https://schema.org",
"@type": "SoftwareSourceCode",
"name": "youtubedown.pl",
"description": "Perl module for youtubedown",
"dateModified": "2016-12-11",
"dateCreated": "2025-03-23",
"contentSize": "71.3 KB",
"contentUrl": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/youtubedown.pl",
"encodingFormat": "text/x-perl",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "Perl"
},
"codeRepository": "https://www.artikelschreiber.com/opensource/youtube-mp3-converter/wwwroot/exec/"
}