Skip to content
Browse files

Merge pull request #1 from GunioRobot/clean

Automatically Removed Whitespace
  • Loading branch information...
2 parents c5adc50 + bbd0de0 commit 89cfd9be3ac7513733a83834527ad0d3a98d28a6 @gregf committed
Showing with 197 additions and 197 deletions.
  1. +10 −10 audiotag
  2. +1 −1 cave-update
  3. +1 −1 clean_music
  4. +1 −1 clipboard
  5. +15 −15 colortest
  6. +1 −1 d
  7. +2 −2 decrypt
  8. +2 −2 decrypt_cat
  9. +3 −3 encrypt
  10. +77 −77 get_flash_videos
  11. +3 −3 git-track
  12. +1 −1 listcolors
  13. +3 −3 mkstage4
  14. +24 −24 mysqltuner.pl
  15. +2 −2 quake2world
  16. +5 −5 screencast
  17. +1 −1 ssh-pushkey
  18. +1 −1 ssh-pushkeys
  19. +44 −44 youtube-dl
View
20 audiotag
@@ -86,12 +86,12 @@ my %Options = (
);
my %id3_names = (
- # long id? # short id?
- TCON => "GENRE", TCO => "GENRE",
- TRCK => "TRACKNUM", TRK => "TRACKNUM",
- TALB => "ALBUM", TAL => "ALBUM",
- TPE1 => "ARTIST", TP1 => "ARTIST",
- TIT2 => "TITLE", TT2 => "TITLE",
+ # long id? # short id?
+ TCON => "GENRE", TCO => "GENRE",
+ TRCK => "TRACKNUM", TRK => "TRACKNUM",
+ TALB => "ALBUM", TAL => "ALBUM",
+ TPE1 => "ARTIST", TP1 => "ARTIST",
+ TIT2 => "TITLE", TT2 => "TITLE",
TYER => "YEAR", TYE => "YEAR",
);
@@ -290,7 +290,7 @@ Option:
%a: artist name
%t: song title
%A: album name
- You can specify subdirectories in the rename
+ You can specify subdirectories in the rename
pattern. "%a - %A/%T. %t" will rename and move
the files. "%a -%A/" moves the files to new
subdirectories without renaming.
@@ -324,7 +324,7 @@ sub rename_file {
$directives{$_} =~ s|/| |g;
}
$directives{'o'} =~ s/\.[^.]*$//;
-
+
$rename_pattern ||= "%T. %a - %t";
if ($convert_spaces) {
@@ -349,7 +349,7 @@ sub rename_file {
if ($@) {
die "Couldn't create $new_path: $@\n";
}
-
+
rename($file, $new_path)
or die "Couldn't rename \`$file' to \`$new_path': $!\n";
}
@@ -674,7 +674,7 @@ sub sane {
"not found in path!";
return 0;
}
-
+
return 1;
}
View
2 cave-update
@@ -37,7 +37,7 @@ ${CAVE} resolve -x sys-apps/paludis > ${LOGFILE}
if [[ $? -ne 0 ]]; then
echo "Failed updating Paludis!"
- echo "Please read the log"
+ echo "Please read the log"
REMOVE_LOG=false
fi
View
2 clean_music
@@ -5,5 +5,5 @@ EXTS=("*.jpg" "*.nfo" "*.gif" "*.ini" "*.txt" "*.url" "*.m3u" "*.dat" "*.sfv" "*
cd /storage/music/ || exit 1
for ext in ${EXTS[@]}; do
- find . -iname "${ext}" -exec rm {} \;
+ find . -iname "${ext}" -exec rm {} \;
done
View
2 clipboard
@@ -1,4 +1,4 @@
#!/bin/sh
REGEX="((ftp|http|mail)(s)?:\/\/)?\w?.\w*.\w{2,}.*?"
${BROWSER} `xclip -o`
-exit 0
+exit 0
View
30 colortest
@@ -25,20 +25,20 @@ print "*\n";
print "**************************\n";
if( $ARGV[0] eq "-w" || $ARGV[1] eq "-w" || $ARGV[2] eq "-w" ) {
- push(@arr, [( "[38;5;16m 16: 00/00/00", "[38;5;17m 17: 00/00/5f", "[38;5;18m 18: 00/00/87", "[38;5;19m 19: 00/00/af", "[38;5;20m 20: 00/00/d7", "[38;5;21m 21: 00/00/ff")] );
- push(@arr, [( "[38;5;22m 22: 00/5f/00", "[38;5;23m 23: 00/5f/5f", "[38;5;24m 24: 00/5f/87", "[38;5;25m 25: 00/5f/af", "[38;5;26m 26: 00/5f/d7", "[38;5;27m 27: 00/5f/ff")] );
- push(@arr, [( "[38;5;28m 28: 00/87/00", "[38;5;29m 29: 00/87/5f", "[38;5;30m 30: 00/87/87", "[38;5;31m 31: 00/87/af", "[38;5;32m 32: 00/87/d7", "[38;5;33m 33: 00/87/ff")] );
- push(@arr, [( "[38;5;34m 34: 00/af/00", "[38;5;35m 35: 00/af/5f", "[38;5;36m 36: 00/af/87", "[38;5;37m 37: 00/af/af", "[38;5;38m 38: 00/af/d7", "[38;5;39m 39: 00/af/ff")] );
- push(@arr, [( "[38;5;40m 40: 00/d7/00", "[38;5;41m 41: 00/d7/5f", "[38;5;42m 42: 00/d7/87", "[38;5;43m 43: 00/d7/af", "[38;5;44m 44: 00/d7/d7", "[38;5;45m 45: 00/d7/ff")] );
- push(@arr, [( "[38;5;46m 46: 00/ff/00", "[38;5;47m 47: 00/ff/5f", "[38;5;48m 48: 00/ff/87", "[38;5;49m 49: 00/ff/af", "[38;5;50m 50: 00/ff/d7", "[38;5;51m 51: 00/ff/ff")] );
- push(@arr, [( "[38;5;52m 52: 5f/00/00", "[38;5;53m 53: 5f/00/5f", "[38;5;54m 54: 5f/00/87", "[38;5;55m 55: 5f/00/af", "[38;5;56m 56: 5f/00/d7", "[38;5;57m 57: 5f/00/ff")] );
- push(@arr, [( "[38;5;58m 58: 5f/5f/00", "[38;5;59m 59: 5f/5f/5f", "[38;5;60m 60: 5f/5f/87", "[38;5;61m 61: 5f/5f/af", "[38;5;62m 62: 5f/5f/d7", "[38;5;63m 63: 5f/5f/ff")] );
- push(@arr, [( "[38;5;64m 64: 5f/87/00", "[38;5;65m 65: 5f/87/5f", "[38;5;66m 66: 5f/87/87", "[38;5;67m 67: 5f/87/af", "[38;5;68m 68: 5f/87/d7", "[38;5;69m 69: 5f/87/ff")] );
- push(@arr, [( "[38;5;70m 70: 5f/af/00", "[38;5;71m 71: 5f/af/5f", "[38;5;72m 72: 5f/af/87", "[38;5;73m 73: 5f/af/af", "[38;5;74m 74: 5f/af/d7", "[38;5;75m 75: 5f/af/ff")] );
- push(@arr, [( "[38;5;76m 76: 5f/d7/00", "[38;5;77m 77: 5f/d7/5f", "[38;5;78m 78: 5f/d7/87", "[38;5;79m 79: 5f/d7/af", "[38;5;80m 80: 5f/d7/d7", "[38;5;81m 81: 5f/d7/ff")] );
- push(@arr, [( "[38;5;82m 82: 5f/ff/00", "[38;5;83m 83: 5f/ff/5f", "[38;5;84m 84: 5f/ff/87", "[38;5;85m 85: 5f/ff/af", "[38;5;86m 86: 5f/ff/d7", "[38;5;87m 87: 5f/ff/ff")] );
- push(@arr, [( "[38;5;88m 88: 87/00/00", "[38;5;89m 89: 87/00/5f", "[38;5;90m 90: 87/00/87", "[38;5;91m 91: 87/00/af", "[38;5;92m 92: 87/00/d7", "[38;5;93m 93: 87/00/ff")] );
- push(@arr, [( "[38;5;94m 94: 87/5f/00", "[38;5;95m 95: 87/5f/5f", "[38;5;96m 96: 87/5f/87", "[38;5;97m 97: 87/5f/af", "[38;5;98m 98: 87/5f/d7", "[38;5;99m 99: 87/5f/ff")] );
+ push(@arr, [( "[38;5;16m 16: 00/00/00", "[38;5;17m 17: 00/00/5f", "[38;5;18m 18: 00/00/87", "[38;5;19m 19: 00/00/af", "[38;5;20m 20: 00/00/d7", "[38;5;21m 21: 00/00/ff")] );
+ push(@arr, [( "[38;5;22m 22: 00/5f/00", "[38;5;23m 23: 00/5f/5f", "[38;5;24m 24: 00/5f/87", "[38;5;25m 25: 00/5f/af", "[38;5;26m 26: 00/5f/d7", "[38;5;27m 27: 00/5f/ff")] );
+ push(@arr, [( "[38;5;28m 28: 00/87/00", "[38;5;29m 29: 00/87/5f", "[38;5;30m 30: 00/87/87", "[38;5;31m 31: 00/87/af", "[38;5;32m 32: 00/87/d7", "[38;5;33m 33: 00/87/ff")] );
+ push(@arr, [( "[38;5;34m 34: 00/af/00", "[38;5;35m 35: 00/af/5f", "[38;5;36m 36: 00/af/87", "[38;5;37m 37: 00/af/af", "[38;5;38m 38: 00/af/d7", "[38;5;39m 39: 00/af/ff")] );
+ push(@arr, [( "[38;5;40m 40: 00/d7/00", "[38;5;41m 41: 00/d7/5f", "[38;5;42m 42: 00/d7/87", "[38;5;43m 43: 00/d7/af", "[38;5;44m 44: 00/d7/d7", "[38;5;45m 45: 00/d7/ff")] );
+ push(@arr, [( "[38;5;46m 46: 00/ff/00", "[38;5;47m 47: 00/ff/5f", "[38;5;48m 48: 00/ff/87", "[38;5;49m 49: 00/ff/af", "[38;5;50m 50: 00/ff/d7", "[38;5;51m 51: 00/ff/ff")] );
+ push(@arr, [( "[38;5;52m 52: 5f/00/00", "[38;5;53m 53: 5f/00/5f", "[38;5;54m 54: 5f/00/87", "[38;5;55m 55: 5f/00/af", "[38;5;56m 56: 5f/00/d7", "[38;5;57m 57: 5f/00/ff")] );
+ push(@arr, [( "[38;5;58m 58: 5f/5f/00", "[38;5;59m 59: 5f/5f/5f", "[38;5;60m 60: 5f/5f/87", "[38;5;61m 61: 5f/5f/af", "[38;5;62m 62: 5f/5f/d7", "[38;5;63m 63: 5f/5f/ff")] );
+ push(@arr, [( "[38;5;64m 64: 5f/87/00", "[38;5;65m 65: 5f/87/5f", "[38;5;66m 66: 5f/87/87", "[38;5;67m 67: 5f/87/af", "[38;5;68m 68: 5f/87/d7", "[38;5;69m 69: 5f/87/ff")] );
+ push(@arr, [( "[38;5;70m 70: 5f/af/00", "[38;5;71m 71: 5f/af/5f", "[38;5;72m 72: 5f/af/87", "[38;5;73m 73: 5f/af/af", "[38;5;74m 74: 5f/af/d7", "[38;5;75m 75: 5f/af/ff")] );
+ push(@arr, [( "[38;5;76m 76: 5f/d7/00", "[38;5;77m 77: 5f/d7/5f", "[38;5;78m 78: 5f/d7/87", "[38;5;79m 79: 5f/d7/af", "[38;5;80m 80: 5f/d7/d7", "[38;5;81m 81: 5f/d7/ff")] );
+ push(@arr, [( "[38;5;82m 82: 5f/ff/00", "[38;5;83m 83: 5f/ff/5f", "[38;5;84m 84: 5f/ff/87", "[38;5;85m 85: 5f/ff/af", "[38;5;86m 86: 5f/ff/d7", "[38;5;87m 87: 5f/ff/ff")] );
+ push(@arr, [( "[38;5;88m 88: 87/00/00", "[38;5;89m 89: 87/00/5f", "[38;5;90m 90: 87/00/87", "[38;5;91m 91: 87/00/af", "[38;5;92m 92: 87/00/d7", "[38;5;93m 93: 87/00/ff")] );
+ push(@arr, [( "[38;5;94m 94: 87/5f/00", "[38;5;95m 95: 87/5f/5f", "[38;5;96m 96: 87/5f/87", "[38;5;97m 97: 87/5f/af", "[38;5;98m 98: 87/5f/d7", "[38;5;99m 99: 87/5f/ff")] );
push(@arr, [( " 100: 87/87/00", " 101: 87/87/5f", " 102: 87/87/87", " 103: 87/87/af", " 104: 87/87/d7", " 105: 87/87/ff")] );
push(@arr, [( " 106: 87/af/00", " 107: 87/af/5f", " 108: 87/af/87", " 109: 87/af/af", " 110: 87/af/d7", " 111: 87/af/ff")] );
push(@arr, [( " 112: 87/d7/00", " 113: 87/d7/5f", " 114: 87/d7/87", " 115: 87/d7/af", " 116: 87/d7/d7", " 117: 87/d7/ff")] );
@@ -70,7 +70,7 @@ if( $ARGV[0] eq "-w" || $ARGV[1] eq "-w" || $ARGV[2] eq "-w" ) {
$padding = " ";
}
else {
-
+
}
# display in reverse order
View
2 d
@@ -1,7 +1,7 @@
#!/bin/sh
if [ "$#" = "0" ]; then
- du -xhs `\ls -A` | sort -rh | $PAGER
+ du -xhs `\ls -A` | sort -rh | $PAGER
else
du -xhs "$@" | sort -rh | $PAGER
fi
View
4 decrypt
@@ -1,10 +1,10 @@
#!/bin/sh
-#
+#
# Decrypt a file with gpg, deleting the encrypted file. See also
# encrypt: I can never remember the correct syntax to encrypt a file
# using gpg. The command to decrypt a file is actually quite easy:
# "gpg -d file.txt.gpg $file.txt". This script exists only for
# completeness--if you've got encrypt, you gotta have decrypt.
-#
+#
# See also encrypt, decrypt_cat.
gpg -d $1 > $(basename $1 .gpg)
View
4 decrypt_cat
@@ -1,9 +1,9 @@
#!/bin/sh
-#
+#
# decrypt_cat -- decrypt file and cat it to screen. Mainly because I
# can't be bothered to remember gpg's options. (I know, this one looks
# really simple, but it's the only one that's simple and I can't be
# bothered to remember that THIS one is simple either. So nyeah.)
-#
+#
# See also encrypt, decrypt
gpg -d $1
View
6 encrypt
@@ -1,10 +1,10 @@
#!/bin/sh
-#
+#
# Because I can never remember the command to encrypt a file using my
# own gpg keys.
-#
+#
# See also decrypt and decrypt_cat.
-#
+#
# TODO: If you are not me, change your name to "David Brady" so the
# following hardcode will work.
gpg -r "Greg Fitzgerald" -e $1 && rm $1
View
154 get_flash_videos
@@ -93,7 +93,7 @@ sub extract_info {
}
return {
- title => $title,
+ title => $title,
meta_title => $meta_title,
};
}
@@ -163,7 +163,7 @@ sub title_to_filename {
$title =~ s/\s+/_/g;
$title =~ s/[^\w\-,()&]/_/g;
$title =~ s/^_+|_+$//g; # underscores at the start and end look bad
-
+
return get_video_filename($type) unless $title;
return "$title.$type";
@@ -172,15 +172,15 @@ sub title_to_filename {
sub get_video_filename {
my($type) = @_;
$type ||= "flv";
- return "video" . get_timestamp_in_iso8601_format() . "." . $type;
+ return "video" . get_timestamp_in_iso8601_format() . "." . $type;
}
-sub get_timestamp_in_iso8601_format {
- use Time::localtime;
- my $time = localtime;
- return sprintf("%04d%02d%02d%02d%02d%02d",
- $time->year + 1900, $time->mon + 1,
- $time->mday, $time->hour, $time->min, $time->sec);
+sub get_timestamp_in_iso8601_format {
+ use Time::localtime;
+ my $time = localtime;
+ return sprintf("%04d%02d%02d%02d%02d%02d",
+ $time->year + 1900, $time->mon + 1,
+ $time->mday, $time->hour, $time->min, $time->sec);
}
sub get_vlc_exe_from_registry {
@@ -196,7 +196,7 @@ sub get_vlc_exe_from_registry {
require Win32::Registry;
Win32::Registry->import();
-
+
my $local_machine;
{
@@ -226,7 +226,7 @@ sub get_vlc_exe_from_registry {
last;
}
}
-
+
return $vlc_binary;
}
@@ -304,7 +304,7 @@ sub convert_sami_subtitles_to_srt {
$milliseconds);
if ($count and !$subtitles[$count - 1]->{end}) {
- $subtitles[$count - 1]->{end} = $begin;
+ $subtitles[$count - 1]->{end} = $begin;
}
if (!$subtitle_text or $subtitle_text eq ' ') {
@@ -395,7 +395,7 @@ sub search {
}
my $xml = from_xml($browser, KeyAttr => [], ForceArray => ['entry']);
-
+
my @matches = map { _process_4od_result($_) }
grep { $_->{author}->{name} =~ /^4oD\w+$/i } @{ $xml->{entry} };
@@ -510,7 +510,7 @@ sub handle_abc_clip {
"http://ll.static.abc.com/vp2/ws/s/contents/1000/videomrss?" .
"brand=001&device=001&width=644&height=362&clipId=%s" .
"&start=0&limit=1&fk=CATEGORIES&fv=%s";
-
+
my $abc_clip_rss_url = sprintf $abc_clip_rss_url_template,
$video_id, $playlist_id;
@@ -772,7 +772,7 @@ sub find_video {
sub can_handle {
my($self, $browser, $url) = @_;
- return $browser->content =~ $JS_RE;
+ return $browser->content =~ $JS_RE;
}
1;
@@ -804,7 +804,7 @@ sub find_video {
}
else {
my ($video_id, $session_id);
-
+
if ($browser->content =~
/swfParams\.mediaObjectId = ["'](.*?)["']/) {
$video_id = $1;
@@ -842,7 +842,7 @@ sub parse_smil_like_xml {
my $title;
- my $video_ref = $parsed_smil->{videoObject}->{smil}->{body}->{switch}->{video};
+ my $video_ref = $parsed_smil->{videoObject}->{smil}->{body}->{switch}->{video};
if (ref($video_ref) ne 'ARRAY') {
my $id;
@@ -858,7 +858,7 @@ sub parse_smil_like_xml {
}
}
- $video_ref = $parsed_smil->{videoObject}->{$id}->{smil}->{body}->{switch}->{video};
+ $video_ref = $parsed_smil->{videoObject}->{$id}->{smil}->{body}->{switch}->{video};
}
my @different_quality_videos = map { $_->{src} }
@@ -1051,7 +1051,7 @@ sub find_video {
$data->{app} = "$info->{application}?_fcs_vhost=$info->{server}" .
"&$token";
-
+
$data->{tcUrl} = "rtmp://$info->{server}/$info->{application}?_fcs_vhost=$info->{server}"
. "&$token";
@@ -1442,7 +1442,7 @@ sub find_video {
"in your area";
exit 1;
}
-
+
$browser->allow_redirects;
$browser->content =~ /<h1[^>]*>(.*?)<\//;
@@ -1710,7 +1710,7 @@ sub _get_soap_xml {
<i0:pu></i0:pu>
<i0:pid>1F866AF1-1DB0-4864-BCA1-6236377B518F</i0:pid>
</i0:rq>
-</i0:ad>
+</i0:ad>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF
@@ -1776,7 +1776,7 @@ sub find_video {
}
$browser->post(
- "http://freevideo.ru/video/view/url/-/" . int(rand 100_000),
+ "http://freevideo.ru/video/view/url/-/" . int(rand 100_000),
[
onLoad => '[type Function]',
highquality => 0,
@@ -1970,7 +1970,7 @@ sub play {
my $binary_no_path = File::Basename::basename $vlc_binary;
- my $binary_just_path = File::Basename::dirname $vlc_binary;
+ my $binary_just_path = File::Basename::dirname $vlc_binary;
my $process;
Win32::Process::Create(
@@ -2015,7 +2015,7 @@ sub download {
$self->{stream}->() if defined $self->{stream};
return;
}
-
+
info "File $self->{printable_filename} already exists, seeing if resuming is supported.";
if (!$response->header('Accept-Ranges')) {
if(!$::opt{yes}) {
@@ -2035,14 +2035,14 @@ sub download {
open my $video_fh, $mode, $file or die $!;
binmode $video_fh;
- $self->{fh} = $video_fh;
+ $self->{fh} = $video_fh;
info "Downloading $url...";
if ($offset) {
$browser->add_header("Range", "bytes=$offset-");
}
- my $response = $browser->get($url,
- ':content_cb' => sub {
+ my $response = $browser->get($url,
+ ':content_cb' => sub {
my ($data, $response) = @_;
if (!$self->{content_length}) {
@@ -2347,7 +2347,7 @@ sub search {
my($self, $search, $type) = @_;
my $browser = FlashVideo::Mechanize->new;
-
+
$browser->get('http://video.google.com/');
$browser->submit_form(
@@ -2358,11 +2358,11 @@ sub search {
return unless $browser->success;
- my @links = map {
+ my @links = map {
chomp(my $name = $_->text);
{ name => $name, url => $_->url_abs->as_string }
}
- grep {
+ grep {
$_->attrs->{onclick} =~ /return resultClick/
|| $_->attrs->{onmousedown} =~ /video_result/
|| $_->attrs->{class} eq 'l'
@@ -2572,7 +2572,7 @@ sub find_video {
my $file_embed_tag;
if ($browser->content =~ /file_embed_tag(?:%3D|=)(\w+)\W/) {
- $file_embed_tag = $1;
+ $file_embed_tag = $1;
}
else {
die "Unable to get file_embed_tag";
@@ -2916,7 +2916,7 @@ sub find_video {
$browser->content =~ /id="videosPageMainTitleH1">(.*?)</s;
$title = $1;
}
-
+
my $filename = title_to_filename(decode_entities($title));
my $flashvars = ($browser->content =~ m'flashvars:(?:\s+getPlayerData\(\)\s+\+\s+)?"([^"]+)')[0];
@@ -2974,7 +2974,7 @@ sub find_video {
sub can_handle {
my($self, $browser, $url) = @_;
- return $browser->content =~ $JS_RE;
+ return $browser->content =~ $JS_RE;
}
1;
@@ -3092,7 +3092,7 @@ sub find_video {
return {
rtmp => $rtmpurl,
swfUrl => "http://www.nbc.com/[[IMPORT]]/video.nbcuni.com/outlet/extensions/inext_video_player/video_player_extension.swf?4.5.3",
- tcUrl => "rtmp://$ip:$port/$app?_fcs_vhost=$host",
+ tcUrl => "rtmp://$ip:$port/$app?_fcs_vhost=$host",
flv => title_to_filename($title)
};
}
@@ -3141,7 +3141,7 @@ bHV0aW9uPTEwMjQsNzY4LCBkcGk9OTY=
EOF
my $data = Data::AMF::Packet->new->deserialize($packet);
-
+
$data->messages->[0]->{value}->[1] = $data->messages->[1]->{value}->[1] = $mid;
$data = $data->serialize;
@@ -3158,7 +3158,7 @@ EOF
$data = $browser->content;
-
+
my($title) = $data =~ m'title.{3}([^\0]+)';
@@ -3283,7 +3283,7 @@ sub find_video {
my ($self, $browser, $page_url) = @_;
my $video_info_url;
- my $host = $browser->uri->host;
+ my $host = $browser->uri->host;
if ( ($browser->content =~ /data_url:\s+'([^']+)'/) or
($browser->content =~ m{displayVideoPlayer\('([^']+)'\)})) {
@@ -3306,7 +3306,7 @@ sub find_video {
die "Couldn't download Red Bull video info XML: " .
$browser->response->status_line;
}
-
+
my $xml = $browser->content;
$xml =~ s/&amp;//g;
$xml = decode_entities($xml);
@@ -3314,14 +3314,14 @@ sub find_video {
my $video_info = from_xml($xml);
my $file_type = "flv";
-
+
if ($video_info->{high_video_url} =~ /\.mp4$/) {
$file_type = "mp4";
}
return {
flv => title_to_filename($video_info->{title}, $file_type),
- rtmp => $video_info->{high_video_url},
+ rtmp => $video_info->{high_video_url},
};
}
@@ -3393,7 +3393,7 @@ sub find_video {
(my $content = $browser->content) =~ s{\\/}{/}g;
my %seen; # avoid duplication in filenames
-
+
my %metadata = map { $_ => '' } qw(brandTitle seriesTitle programmeTitle);
foreach my $metadata_item (keys %metadata) {
@@ -3447,7 +3447,7 @@ sub find_video {
$browser->get($subtitles_url);
if ($browser->success) {
- my $srt_filename = title_to_filename($title, "srt");
+ my $srt_filename = title_to_filename($title, "srt");
convert_sami_subtitles_to_srt($browser->content, $srt_filename);
@@ -3601,7 +3601,7 @@ sub find_video {
$browser->get($configpath);
my $config = from_xml($browser);
-
+
my($title, $location);
eval {
@@ -3749,7 +3749,7 @@ sub find_video {
my $perfomer_id;
if ($browser->content =~ /profileUserId=(\d+)/) {
- $perfomer_id = $1;
+ $perfomer_id = $1;
}
else {
die "Can't get performer ID";
@@ -3781,7 +3781,7 @@ sub find_video {
if ($name eq 'freeServerIP') {
$value = (split /,/, $value)[0];
}
-
+
$stream_info{$name} = $value;
}
@@ -4185,7 +4185,7 @@ sub find_video {
}
my $type = $info{fileurl} =~ /\.mp4/i ? 'mp4' : 'flv';
-
+
return $info{fileurl}, title_to_filename($info{title}, $type);
}
@@ -4474,11 +4474,11 @@ sub find_video {
$playlist_url =
"http://www.videojug.com/views/interview/playlist.aspx?ar=16_9&id=";
- $interview_clip = $browser->uri->fragment;
+ $interview_clip = $browser->uri->fragment;
}
my $video_id;
-
+
if ($browser->content =~
/<meta name=["']video-id["'] content="([A-F0-9a-f\-]+)"/) {
$video_id = $1;
@@ -4500,7 +4500,7 @@ sub find_video {
my ($prefix, $title);
if ($interview_clip) {
- ($prefix, $title) = get_prefix_and_title($xml, $interview_clip);
+ ($prefix, $title) = get_prefix_and_title($xml, $interview_clip);
}
else {
$prefix = $xml->{Items}->{Media}->{Prefix};
@@ -4564,7 +4564,7 @@ sub find_video {
playpath => $playpath,
flv => title_to_filename("$author - $title")
};
-
+
return $data;
}
@@ -4640,7 +4640,7 @@ sub find_video {
my $file_type = 'flv';
$browser->head($url);
-
+
if (!$browser->success) {
die "Couldn't do HEAD request $url: " . $browser->response->status_line;
}
@@ -4662,7 +4662,7 @@ sub find_video {
}
}
else {
- die "Unexpected Content-Type ($content_type) from Wat server.";
+ die "Unexpected Content-Type ($content_type) from Wat server.";
}
my $filename = title_to_filename($title, $file_type);
@@ -4696,7 +4696,7 @@ sub find_video {
$browser->content =~ /(?:<span class="style5">|<td style="font-size: 20px;">\s*)<strong>([^<]+)/;
my $filename = title_to_filename($1);
-
+
return $url, $filename;
}
@@ -4756,7 +4756,7 @@ sub find_video {
$videoID, rand( 10000 ), 3 );
$check_response->( "Couldn't grab video informaton from youku, server response was %s" );
- return parse_video_info( $browser, $browser->content );
+ return parse_video_info( $browser, $browser->content );
}
sub parse_video_info {
@@ -5108,7 +5108,7 @@ sub verify_age {
my($browser) = @_;
my $orig_uri = $browser->uri;
- if ($browser->response->code == 303
+ if ($browser->response->code == 303
&& $browser->response->header('Location') =~ m!/verify_age|/accounts/!) {
my $confirmation_url = $browser->response->header('Location');
@@ -5262,7 +5262,7 @@ sub parse_youtube_format_url_map {
$map->{$format} = $url;
}
-
+
return $map;
}
@@ -5359,7 +5359,7 @@ sub find_video {
if ($flv_urls[-1] =~ /^http%3a%2f%2f/) {
$flv_urls[-1] = uri_unescape($flv_urls[-1])
}
-
+
$actual_url = url_exists($browser->clone, $flv_urls[-1]);
}
@@ -5399,7 +5399,7 @@ sub find_video {
}
my @filenames;
-
+
return $actual_url, $possible_filename if $filename_is_reliable;
$possible_filename =~ s/\?.*//;
@@ -5411,7 +5411,7 @@ sub find_video {
$title && $title !~ /\Q$possible_filename\E/i;
push @filenames, get_video_filename() if !@filenames;
-
+
return $actual_url, @filenames if $actual_url;
@@ -5512,7 +5512,7 @@ sub find_file_param {
if($param =~ m{(rtmp://[^ &"']+)}) {
info "This looks like RTMP ($1), no generic support yet..";
}
-
+
return;
}
@@ -5605,11 +5605,11 @@ sub find_package {
my $package = find_package_url($url, $browser);
if(!defined $package) {
-
+
for my $possible_url($browser->content =~
m!(?:<object[^>]+>.*?|<(?:script|embed|iframe|param) [^>]*(?:src=["']?|name=["']src["']\ value=["']))(http://[^"'> ]+)!gixs) {
$package = find_package_url($possible_url, $browser);
-
+
return _found($package, $possible_url) if defined $package;
}
}
@@ -5708,7 +5708,7 @@ sub download {
my($r_fh, $w_fh); # So Perl doesn't close them behind our back..
if ($rtmp_data->{live} && $::opt{play}) {
-
+
pipe($r_fh, $w_fh);
my $pid = fork;
@@ -5805,7 +5805,7 @@ sub run {
kill 'TERM', $pid;
exit;
};
- }
+ }
my $complete = 0;
my $buf = "";
@@ -5889,10 +5889,10 @@ my @sites_with_search = ('4oD', 'GoogleVideoSearch');
sub search {
my ($search, $max_per_site, $max_results) = @_;
- my @search_sites = map { /^FlashVideo::Site::/ ? $_
+ my @search_sites = map { /^FlashVideo::Site::/ ? $_
: "FlashVideo::Site::$_"; }
map { ucfirst lc } @sites_with_search;
-
+
unless ($::SCRIPT_NAME) {
eval "require $_" for @search_sites;
}
@@ -6011,12 +6011,12 @@ sub name {
sub choose {
my($self, @available) = @_;
-
+
my $max_preferred_res = $self->quality_to_resolution($self->name);
my $max_preferred_size = $max_preferred_res->[0] * $max_preferred_res->[1];
- my @sorted =
+ my @sorted =
sort { $a->[0] <=> $b->[0] }
map { my $r = $_->{resolution}; $r = $r->[0] * $r->[1]; [$r, $_] } @available;
@@ -6192,13 +6192,13 @@ A required Perl module for downloading this video is not installed.
EOF
use constant FRIENDLY_FAILURE => <<EOF;
-
+
Couldn't extract Flash movie URL. This site may need specific support adding,
or fixing.
Please confirm the site is using Flash video and if you have Flash available
check that the URL really works(!).
-
+
Check for updates by running: $0 --update
If the latest version does not support this please open a bug (or
@@ -6279,7 +6279,7 @@ if ($search) {
"Downloading only match for '$search': '$results[0]->{name}'" :
"Downloading first match for '$search': '$results[0]->{name}'" ;
info $message;
-
+
push @download_urls, $results[0]->{url};
}
else {
@@ -6287,7 +6287,7 @@ if ($search) {
my $columns = get_terminal_width() - 5;
local $Text::Wrap::columns = $columns;
-
+
my $count = 1;
for my $result(@results) {
printf "[%2d] %s\n", $count, $result->{name};
@@ -6304,7 +6304,7 @@ if ($search) {
"(separate multiple with comma or space): ";
chomp(my $choice = <STDIN>);
$choice ||= 1;
-
+
for(split /[ ,]+/, $choice) {
if (/-/) {
my ($lower, $upper) = split /-/, $choice;
@@ -6333,7 +6333,7 @@ if ($search) {
print STDERR "No results found for '$search'.\n";
exit 1;
}
-
+
}
else {
@download_urls = @urls;
@@ -6591,7 +6591,7 @@ sub update_plugins {
sub install_plugin {
my ($browser, $url, $file) = @_;
- my $plugin_exists = -f $file;
+ my $plugin_exists = -f $file;
my $new_file = $plugin_exists ? "$file.new" : $file;
@@ -6608,7 +6608,7 @@ sub install_plugin {
info "(previous version backed up to $file.old).";
}
else {
- info "New plugin $short_name installed as $file";
+ info "New plugin $short_name installed as $file";
}
return 1;
@@ -6634,7 +6634,7 @@ sub plugin_loader {
return $plugin_fh; # Perl then reads the plugin from the FH
}
}
-
+
return;
}
View
6 git-track
@@ -1,13 +1,13 @@
#!/bin/sh
-#
+#
# I stole this one off the internet when somebody tweeted about it.
# It's pretty brilliant. Can't remember the author. Contact me if you
# recognize this code, and I'll give credit where it is due.
branch=$(git branch 2>/dev/null | grep ^\*)
[ x$1 != x ] && tracking=$1 || tracking=${branch/* /}
-
+
git config branch.$tracking.remote origin
git config branch.$tracking.merge refs/heads/$tracking
-
+
echo "tracking origin/$tracking"
View
2 listcolors
@@ -4,7 +4,7 @@ clear
echo "Colors"
echo "------"
-for i in {16..255}; do
+for i in {16..255}; do
echo -en "\e[38;5;${i}mCo\e[38;5;${i}m\e[38;1mlor \e[38;5;${i}m$i\e[38;0m\t"
[ $((++j%6)) -eq 0 ] && echo
done
View
6 mkstage4
@@ -7,9 +7,9 @@ then
exit 1
fi
-# checks for correct cmdline usage
-if [ "$#" == "0" ]
-then
+# checks for correct cmdline usage
+if [ "$#" == "0" ]
+then
echo "`basename $0`: too few arguments."
echo "syntax: \$ `basename $0` [-q|--quiet] <backup-filename> [custom-tar-options]"
echo "-q, --quiet: activates quiet mode (no confirmation)."
View
48 mysqltuner.pl
@@ -62,7 +62,7 @@
"skipsize" => 0,
"checkversion" => 0,
);
-
+
# Gather the options from the command line
GetOptions(\%opt,
'nobad',
@@ -426,7 +426,7 @@ sub check_storage_engines {
$engines .= (defined $myvar{'have_federated'} && $myvar{'have_federated'} eq "YES")? greenwrap "+Federated " : redwrap "-Federated " ;
$engines .= (defined $myvar{'have_innodb'} && $myvar{'have_innodb'} eq "YES")? greenwrap "+InnoDB " : redwrap "-InnoDB " ;
$engines .= (defined $myvar{'have_isam'} && $myvar{'have_isam'} eq "YES")? greenwrap "+ISAM " : redwrap "-ISAM " ;
- $engines .= (defined $myvar{'have_ndbcluster'} && $myvar{'have_ndbcluster'} eq "YES")? greenwrap "+NDBCluster " : redwrap "-NDBCluster " ;
+ $engines .= (defined $myvar{'have_ndbcluster'} && $myvar{'have_ndbcluster'} eq "YES")? greenwrap "+NDBCluster " : redwrap "-NDBCluster " ;
print "$engines\n";
if ($mysqlvermajor >= 5) {
# MySQL 5 servers can have table sizes calculated quickly from information schema
@@ -532,11 +532,11 @@ sub calculations {
# Slow queries
$mycalc{'pct_slow_queries'} = int(($mystat{'Slow_queries'}/$mystat{'Questions'}) * 100);
-
+
# Connections
$mycalc{'pct_connections_used'} = int(($mystat{'Max_used_connections'}/$myvar{'max_connections'}) * 100);
$mycalc{'pct_connections_used'} = ($mycalc{'pct_connections_used'} > 100) ? 100 : $mycalc{'pct_connections_used'} ;
-
+
# Key buffers
if ($mysqlvermajor > 3 && !($mysqlvermajor == 4 && $mysqlverminor == 0)) {
$mycalc{'pct_key_buffer_used'} = sprintf("%.1f",(1 - (($mystat{'Key_blocks_unused'} * $myvar{'key_cache_block_size'}) / $myvar{'key_buffer_size'})) * 100);
@@ -551,12 +551,12 @@ sub calculations {
} elsif ($mysqlvermajor >= 5) {
$mycalc{'total_myisam_indexes'} = `mysql $mysqllogin -Bse "SELECT IFNULL(SUM(INDEX_LENGTH),0) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema') AND ENGINE = 'MyISAM';"`;
}
- if (defined $mycalc{'total_myisam_indexes'} and $mycalc{'total_myisam_indexes'} =~ /^0\n$/) {
- $mycalc{'total_myisam_indexes'} = "fail";
+ if (defined $mycalc{'total_myisam_indexes'} and $mycalc{'total_myisam_indexes'} =~ /^0\n$/) {
+ $mycalc{'total_myisam_indexes'} = "fail";
} elsif (defined $mycalc{'total_myisam_indexes'}) {
chomp($mycalc{'total_myisam_indexes'});
}
-
+
# Query cache
if ($mysqlvermajor > 3) {
$mycalc{'query_cache_efficiency'} = sprintf("%.1f",($mystat{'Qcache_hits'} / ($mystat{'Com_select'} + $mystat{'Qcache_hits'})) * 100);
@@ -569,17 +569,17 @@ sub calculations {
$mycalc{'query_cache_prunes_per_day'} = int($mystat{'Qcache_lowmem_prunes'} / ($mystat{'Uptime'}/86400));
}
}
-
+
# Sorting
$mycalc{'total_sorts'} = $mystat{'Sort_scan'} + $mystat{'Sort_range'};
if ($mycalc{'total_sorts'} > 0) {
$mycalc{'pct_temp_sort_table'} = int(($mystat{'Sort_merge_passes'} / $mycalc{'total_sorts'}) * 100);
}
-
+
# Joins
$mycalc{'joins_without_indexes'} = $mystat{'Select_range_check'} + $mystat{'Select_full_join'};
$mycalc{'joins_without_indexes_per_day'} = int($mycalc{'joins_without_indexes'} / ($mystat{'Uptime'}/86400));
-
+
# Temporary tables
if ($mystat{'Created_tmp_tables'} > 0) {
if ($mystat{'Created_tmp_disk_tables'} > 0) {
@@ -588,19 +588,19 @@ sub calculations {
$mycalc{'pct_temp_disk'} = 0;
}
}
-
+
# Table cache
if ($mystat{'Opened_tables'} > 0) {
$mycalc{'table_cache_hit_rate'} = int($mystat{'Open_tables'}*100/$mystat{'Opened_tables'});
} else {
$mycalc{'table_cache_hit_rate'} = 100;
}
-
+
# Open files
if ($myvar{'open_files_limit'} > 0) {
$mycalc{'pct_files_open'} = int($mystat{'Open_files'}*100/$myvar{'open_files_limit'});
}
-
+
# Table locks
if ($mystat{'Table_locks_immediate'} > 0) {
if ($mystat{'Table_locks_waited'} == 0) {
@@ -609,7 +609,7 @@ sub calculations {
$mycalc{'pct_table_locks_immediate'} = int($mystat{'Table_locks_immediate'}*100/($mystat{'Table_locks_waited'} + $mystat{'Table_locks_immediate'}));
}
}
-
+
# Thread cache
$mycalc{'thread_cache_hit_rate'} = int(100 - (($mystat{'Threads_created'} / $mystat{'Connections'}) * 100));
@@ -657,7 +657,7 @@ sub mysql_stats {
} else {
goodprint "Maximum possible memory usage: ".hr_bytes($mycalc{'total_possible_used_memory'})." ($mycalc{'pct_physical_memory'}% of installed RAM)\n";
}
-
+
# Slow queries
if ($mycalc{'pct_slow_queries'} > 5) {
badprint "Slow queries: $mycalc{'pct_slow_queries'}% (".hr_num($mystat{'Slow_queries'})."/".hr_num($mystat{'Questions'}).")\n";
@@ -668,7 +668,7 @@ sub mysql_stats {
if (defined($myvar{'log_slow_queries'})) {
if ($myvar{'log_slow_queries'} eq "OFF") { push(@generalrec,"Enable the slow query log to troubleshoot bad queries"); }
}
-
+
# Connections
if ($mycalc{'pct_connections_used'} > 85) {
badprint "Highest connection usage: $mycalc{'pct_connections_used'}% ($mystat{'Max_used_connections'}/$myvar{'max_connections'})\n";
@@ -678,11 +678,11 @@ sub mysql_stats {
} else {
goodprint "Highest usage of available connections: $mycalc{'pct_connections_used'}% ($mystat{'Max_used_connections'}/$myvar{'max_connections'})\n";
}
-
+
# Key buffer
if (!defined($mycalc{'total_myisam_indexes'}) and $doremote == 1) {
push(@generalrec,"Unable to calculate MyISAM indexes on remote MySQL server < 5.0.0");
- } elsif ($mycalc{'total_myisam_indexes'} =~ /^fail$/) {
+ } elsif ($mycalc{'total_myisam_indexes'} =~ /^fail$/) {
badprint "Cannot calculate MyISAM index size - re-run script as root user\n";
} elsif ($mycalc{'total_myisam_indexes'} == "0") {
badprint "None of your MyISAM tables are indexed - add indexes immediately\n";
@@ -703,9 +703,9 @@ sub mysql_stats {
# No queries have run that would use keys
}
}
-
+
# Query cache
- if ($mysqlvermajor < 4) {
+ if ($mysqlvermajor < 4) {
# MySQL versions < 4.01 don't support query caching
push(@generalrec,"Upgrade MySQL to version 4+ to utilize query caching");
} elsif ($myvar{'query_cache_size'} < 1) {
@@ -732,7 +732,7 @@ sub mysql_stats {
goodprint "Query cache prunes per day: $mycalc{'query_cache_prunes_per_day'}\n";
}
}
-
+
# Sorting
if ($mycalc{'total_sorts'} == 0) {
# For the sake of space, we will be quiet here
@@ -744,7 +744,7 @@ sub mysql_stats {
} else {
goodprint "Sorts requiring temporary tables: $mycalc{'pct_temp_sort_table'}% (".hr_num($mystat{'Sort_merge_passes'})." temp sorts / ".hr_num($mycalc{'total_sorts'})." sorts)\n";
}
-
+
# Joins
if ($mycalc{'joins_without_indexes_per_day'} > 250) {
badprint "Joins performed without indexes: $mycalc{'joins_without_indexes'}\n";
@@ -754,7 +754,7 @@ sub mysql_stats {
# For the sake of space, we will be quiet here
# No joins have run without indexes
}
-
+
# Temporary tables
if ($mystat{'Created_tmp_tables'} > 0) {
if ($mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} < 256*1024*1024) {
@@ -836,7 +836,7 @@ sub mysql_stats {
badprint "Connections aborted: ".$mycalc{'pct_aborted_connections'}."%\n";
push(@generalrec,"Your applications are not closing MySQL connections properly");
}
-
+
# InnoDB
if (defined $myvar{'have_innodb'} && $myvar{'have_innodb'} eq "YES" && defined $enginestats{'InnoDB'}) {
if ($myvar{'innodb_buffer_pool_size'} > $enginestats{'InnoDB'}) {
View
4 quake2world
@@ -19,8 +19,8 @@ function compile {
${SVN} co ${SUBVERSION_URL} quake2world
cd quake2world
autoreconf -i
- ./configure
- make
+ ./configure
+ make
${SUDO} make install
}
View
10 screencast
@@ -112,18 +112,18 @@ fi
# stop recordings
echo ""
echo "Terminating recordings ..."
-kill -15 $pidVideo $pidAudio
+kill -15 $pidVideo $pidAudio
kill -15 $pidSilence
wait
# filter and normalize the audio
-echo ""
-echo "Filtering and normalizing sound ..."
+echo ""
+echo "Filtering and normalizing sound ..."
sox --norm -s -b 16 -L -r 44100 -c 2 "$baseName.raw" "$baseName.wav" highpass 65 lowpass 12k
# encode video and audio into avi file
-echo ""
-echo "Encoding to final avi ..."
+echo ""
+echo "Encoding to final avi ..."
ffmpeg -isync -i "$baseName.wav" -i "$baseName.mpeg" -acodec mp2 -ab 192k -vcodec copy "$baseName.avi"
# convert to ogg - to turn on uncomment next three lines
View
2 ssh-pushkey
@@ -1,7 +1,7 @@
#!/bin/sh
# ssh-pushkey: Add an sshkey to a remote server. Ensures .ssh/ and
# .ssh/authorized_keys exist and are chmod 700 and 600 respectively.
-#
+#
# Usage: ssh-pushkey host key
HOST=$1
KEYSRC=$2
View
2 ssh-pushkeys
@@ -12,7 +12,7 @@ echo "ssh $HOST mkdir .ssh..."
ssh $HOST mkdir .ssh
echo "scp id_*.pub $HOST:.ssh/..."
-scp id_*.pub $HOST:.ssh/
+scp id_*.pub $HOST:.ssh/
echo "for key in id_*.pub; do..."
for key in id_*.pub; do
View
88 youtube-dl
@@ -53,7 +53,7 @@ def preferredencoding():
def htmlentity_transform(matchobj):
"""Transforms an HTML entity to a Unicode character.
-
+
This function receives a match object and is intended to be used with
the re.sub() function.
"""
@@ -108,7 +108,7 @@ def sanitize_open(filename, open_mode):
class DownloadError(Exception):
"""Download Error exception.
-
+
This exception may be thrown by FileDownloader objects if they are not
configured to continue on errors. They will contain the appropriate
error message.
@@ -212,7 +212,7 @@ class FileDownloader(object):
self._download_retcode = 0
self._num_downloads = 0
self.params = params
-
+
@staticmethod
def pmkdir(filename):
"""Create directory components in filename. Similar to Unix "mkdir -p"."""
@@ -222,7 +222,7 @@ class FileDownloader(object):
for dir in aggregate:
if not os.path.exists(dir):
os.mkdir(dir)
-
+
@staticmethod
def format_bytes(bytes):
if bytes is None:
@@ -291,12 +291,12 @@ class FileDownloader(object):
"""Add an InfoExtractor object to the end of the list."""
self._ies.append(ie)
ie.set_downloader(self)
-
+
def add_post_processor(self, pp):
"""Add a PostProcessor object to the end of the chain."""
self._pps.append(pp)
pp.set_downloader(self)
-
+
def to_stdout(self, message, skip_eol=False, ignore_encoding_errors=False):
"""Print message to stdout if not in quiet mode."""
try:
@@ -306,11 +306,11 @@ class FileDownloader(object):
except (UnicodeEncodeError), err:
if not ignore_encoding_errors:
raise
-
+
def to_stderr(self, message):
"""Print message to stderr."""
print >>sys.stderr, message.encode(preferredencoding())
-
+
def fixed_template(self):
"""Checks if the output template is fixed."""
return (re.search(ur'(?u)%\(.+?\)s', self.params['outtmpl']) is None)
@@ -344,7 +344,7 @@ class FileDownloader(object):
def report_destination(self, filename):
"""Report destination filename."""
self.to_stdout(u'[download] Destination: %s' % filename, ignore_encoding_errors=True)
-
+
def report_progress(self, percent_str, data_len_str, speed_str, eta_str):
"""Report download progress."""
if self.params.get('noprogress', False):
@@ -355,29 +355,29 @@ class FileDownloader(object):
def report_resuming_byte(self, resume_len):
"""Report attempt to resume at given byte."""
self.to_stdout(u'[download] Resuming download at byte %s' % resume_len)
-
+
def report_retry(self, count, retries):
"""Report retry in case of HTTP error 503"""
self.to_stdout(u'[download] Got HTTP error 503. Retrying (attempt %d of %d)...' % (count, retries))
-
+
def report_file_already_downloaded(self, file_name):
"""Report file has already been fully downloaded."""
try:
self.to_stdout(u'[download] %s has already been downloaded' % file_name)
except (UnicodeEncodeError), err:
self.to_stdout(u'[download] The file has already been downloaded')
-
+
def report_unable_to_resume(self):
"""Report it was impossible to resume download."""
self.to_stdout(u'[download] Unable to resume')
-
+
def report_finish(self):
"""Report download finished."""
if self.params.get('noprogress', False):
self.to_stdout(u'[download] Download completed')
else:
self.to_stdout(u'')
-
+
def increment_downloads(self):
"""Increment the ordinal that assigns a number to each file."""
self._num_downloads += 1
@@ -397,7 +397,7 @@ class FileDownloader(object):
print info_dict['description'].encode(preferredencoding(), 'xmlcharrefreplace')
return
-
+
try:
template_dict = dict(info_dict)
template_dict['epoch'] = unicode(long(time.time()))
@@ -468,7 +468,7 @@ class FileDownloader(object):
info = pp.run(info)
if info is None:
break
-
+
def _download_with_rtmpdump(self, filename, url, player_url):
self.report_destination(filename)
@@ -674,7 +674,7 @@ class InfoExtractor(object):
def set_downloader(self, downloader):
"""Sets the downloader for this IE."""
self._downloader = downloader
-
+
def _real_initialize(self):
"""Real initialization process. Redefine in subclasses."""
pass
@@ -715,31 +715,31 @@ class YoutubeIE(InfoExtractor):
def report_login(self):
"""Report attempt to log in."""
self._downloader.to_stdout(u'[youtube] Logging in')
-
+
def report_age_confirmation(self):
"""Report attempt to confirm age."""
self._downloader.to_stdout(u'[youtube] Confirming age')
-
+
def report_video_webpage_download(self, video_id):
"""Report attempt to download video webpage."""
self._downloader.to_stdout(u'[youtube] %s: Downloading video webpage' % video_id)
-
+
def report_video_info_webpage_download(self, video_id):
"""Report attempt to download video info webpage."""
self._downloader.to_stdout(u'[youtube] %s: Downloading video info webpage' % video_id)
-
+
def report_information_extraction(self, video_id):
"""Report attempt to extract video information."""
self._downloader.to_stdout(u'[youtube] %s: Extracting video information' % video_id)
-
+
def report_unavailable_format(self, video_id, format):
"""Report extracted video URL."""
self._downloader.to_stdout(u'[youtube] %s: Format %s not available' % (video_id, format))
-
+
def report_rtmp_download(self):
"""Indicate the download will use the RTMP protocol."""
self._downloader.to_stdout(u'[youtube] RTMP download detected')
-
+
def _real_initialize(self):
if self._downloader is None:
return
@@ -795,7 +795,7 @@ class YoutubeIE(InfoExtractor):
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
self._downloader.to_stderr(u'WARNING: unable to log in: %s' % str(err))
return
-
+
# Confirm age
age_form = {
'next_url': '/',
@@ -971,11 +971,11 @@ class MetacafeIE(InfoExtractor):
def report_age_confirmation(self):
"""Report attempt to confirm age."""
self._downloader.to_stdout(u'[metacafe] Confirming age')
-
+
def report_download_webpage(self, video_id):
"""Report webpage download."""
self._downloader.to_stdout(u'[metacafe] %s: Downloading webpage' % video_id)
-
+
def report_extraction(self, video_id):
"""Report information extraction."""
self._downloader.to_stdout(u'[metacafe] %s: Extracting information' % video_id)
@@ -1002,7 +1002,7 @@ class MetacafeIE(InfoExtractor):
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
self._downloader.trouble(u'ERROR: unable to confirm age: %s' % str(err))
return
-
+
def _real_extract(self, url):
# Extract id and simplified title from URL
mobj = re.match(self._VALID_URL, url)
@@ -1038,7 +1038,7 @@ class MetacafeIE(InfoExtractor):
if mobj is not None:
mediaURL = urllib.unquote(mobj.group(1))
video_extension = mediaURL[-3:]
-
+
# Extract gdaKey if available
mobj = re.search(r'(?m)&gdaKey=(.*?)&', webpage)
if mobj is None:
@@ -1107,7 +1107,7 @@ class DailymotionIE(InfoExtractor):
def report_download_webpage(self, video_id):
"""Report webpage download."""
self._downloader.to_stdout(u'[dailymotion] %s: Downloading webpage' % video_id)
-
+
def report_extraction(self, video_id):
"""Report information extraction."""
self._downloader.to_stdout(u'[dailymotion] %s: Extracting information' % video_id)
@@ -1638,7 +1638,7 @@ class YoutubeSearchIE(InfoExtractor):
def __init__(self, youtube_ie, downloader=None):
InfoExtractor.__init__(self, downloader)
self._youtube_ie = youtube_ie
-
+
@staticmethod
def suitable(url):
return (re.match(YoutubeSearchIE._VALID_QUERY, url) is not None)
@@ -1650,7 +1650,7 @@ class YoutubeSearchIE(InfoExtractor):
def _real_initialize(self):
self._youtube_ie.initialize()
-
+
def _real_extract(self, query):
mobj = re.match(self._VALID_QUERY, query)
if mobj is None:
@@ -1729,7 +1729,7 @@ class GoogleSearchIE(InfoExtractor):
def __init__(self, google_ie, downloader=None):
InfoExtractor.__init__(self, downloader)
self._google_ie = google_ie
-
+
@staticmethod
def suitable(url):
return (re.match(GoogleSearchIE._VALID_QUERY, url) is not None)
@@ -1741,7 +1741,7 @@ class GoogleSearchIE(InfoExtractor):
def _real_initialize(self):
self._google_ie.initialize()
-
+
def _real_extract(self, query):
mobj = re.match(self._VALID_QUERY, query)
if mobj is None:
@@ -1820,7 +1820,7 @@ class YahooSearchIE(InfoExtractor):
def __init__(self, yahoo_ie, downloader=None):
InfoExtractor.__init__(self, downloader)
self._yahoo_ie = yahoo_ie
-
+
@staticmethod
def suitable(url):
return (re.match(YahooSearchIE._VALID_QUERY, url) is not None)
@@ -1832,7 +1832,7 @@ class YahooSearchIE(InfoExtractor):
def _real_initialize(self):
self._yahoo_ie.initialize()
-
+
def _real_extract(self, query):
mobj = re.match(self._VALID_QUERY, query)
if mobj is None:
@@ -1911,7 +1911,7 @@ class YoutubePlaylistIE(InfoExtractor):
def __init__(self, youtube_ie, downloader=None):
InfoExtractor.__init__(self, downloader)
self._youtube_ie = youtube_ie
-
+
@staticmethod
def suitable(url):
return (re.match(YoutubePlaylistIE._VALID_URL, url) is not None)
@@ -1922,7 +1922,7 @@ class YoutubePlaylistIE(InfoExtractor):
def _real_initialize(self):
self._youtube_ie.initialize()
-
+
def _real_extract(self, url):
# Extract playlist id
mobj = re.match(self._VALID_URL, url)
@@ -1959,7 +1959,7 @@ class YoutubePlaylistIE(InfoExtractor):
playliststart -= 1 #our arrays are zero-based but the playlist is 1-based
if playliststart > 0:
video_ids = video_ids[playliststart:]
-
+
for id in video_ids:
self._youtube_ie.extract('http://www.youtube.com/watch?v=%s' % id)
return
@@ -1975,7 +1975,7 @@ class YoutubeUserIE(InfoExtractor):
def __init__(self, youtube_ie, downloader=None):
InfoExtractor.__init__(self, downloader)
self._youtube_ie = youtube_ie
-
+
@staticmethod
def suitable(url):
return (re.match(YoutubeUserIE._VALID_URL, url) is not None)
@@ -1986,7 +1986,7 @@ class YoutubeUserIE(InfoExtractor):
def _real_initialize(self):
self._youtube_ie.initialize()
-
+
def _real_extract(self, url):
# Extract username
mobj = re.match(self._VALID_URL, url)
@@ -2018,7 +2018,7 @@ class YoutubeUserIE(InfoExtractor):
playliststart = self._downloader.params.get('playliststart', 1)
playliststart = playliststart-1 #our arrays are zero-based but the playlist is 1-based
if playliststart > 0:
- video_ids = video_ids[playliststart:]
+ video_ids = video_ids[playliststart:]
for id in video_ids:
self._youtube_ie.extract('http://www.youtube.com/watch?v=%s' % id)
@@ -2049,7 +2049,7 @@ class PostProcessor(object):
def set_downloader(self, downloader):
"""Sets the downloader for this PP."""
self._downloader = downloader
-
+
def run(self, information):
"""Run the PostProcessor.
@@ -2069,7 +2069,7 @@ class PostProcessor(object):
it was called from.
"""
return information # by default, do nothing
-
+
### MAIN PROGRAM ###
if __name__ == '__main__':
try:

0 comments on commit 89cfd9b

Please sign in to comment.
Something went wrong with that request. Please try again.