Package: get-flash-videos
Version: 1.25~git2012.06.27-1
Severity: important
Tags: patch

The Google video search function was broken.
A blind friend was dependent on it as one tool for searching and listening to 
videos.

This should include a script to apply 3 patches, to

/usr/bin/get_flash_videos
/usr/share/perl5/FlashVideos/Search.pm
and
/usr/share/perl5/FlashVideos/Site/Googlevideosearch.pm

These fix the search function, add 2 new paramters
(search results page and search results from the page to display),
and to document (in --help) the '--' end of input parameters.


Thanks if you can get this (or anything inspired by it or equivalent) into
the code base for this tool.

Regards, Dallas E. Legan II / le...@acm.org / aw...@lafn.org
http://isthereanotherquestion.blogspot.com
************************************************************************
"Tekeli-li! Tekeli-li!"
        - "At the Mountains of Madness", H.P. Lovecraft


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages get-flash-videos depends on:
ii  libcrypt-blowf 2.14-1+b1                 Blowfish cryptography for Perl
ii  libdata-amf-pe 0.09-3                    Perl module for serialize / deseri
ii  libhtml-parser 3.71-1+b1                 collection of modules that parse H
ii  libhtml-tree-p 5.02-1                    Perl module to represent and creat
ii  libtie-ixhash- 1.23-1                    Perl module to order associative a
ii  liburi-perl    1.60-1                    module to manipulate and access UR
ii  libwww-mechani 1.71-1                    module to automate interaction wit
ii  libwww-perl    6.05-1                    simple and consistent interface to
ii  perl           5.18.1-4                  Larry Wall's Practical Extraction 
ii  rtmpdump       2.4+20121230.gitdf6c518-1 small dumper for media content str

Versions of packages get-flash-videos recommends:
ii  get-iplayer                   2.83-1     download/stream available BBC iPla
ii  libcrypt-rijndael-perl        1.11-1+b1  Perl module implementing the Rijnd
ii  liblwp-protocol-socks-perl    1.6-1      SOCKS proxy support for LWP
ii  libxml-simple-perl            2.20-1     Perl module for reading and writin

Versions of packages get-flash-videos suggests:
ii  mplayer                     3:1.1.1-dmo6 Ultimate Movie Player For Linux.

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/bin/get_flash_videos (from get-flash-videos package)
debsums: changed file /usr/share/perl5/FlashVideo/Search.pm (from 
get-flash-videos package)
debsums: changed file /usr/share/perl5/FlashVideo/Site/Googlevideosearch.pm 
(from get-flash-videos package)
#!/bin/bash

:<<EXPLINATION

Attached should be a .sh script to apply 3 patches to the Debian
installation of get-flash-videos.

These impliment my current best fix for the broken search function.
They also impliment -F (--first) and -P (--page) parameters
to the command line to display the the 'first' <n> (out of 100 results)
of the hits for a page, and to display the <m> page (1 page being 100 results).

For example 

.... -P 3  -F 30 .....

would display the first 30 results of the 3rd page of results
(results 201-230).

I've tried to keep the case indifference for other command line settings.
(These 2 conflicted with -f and -p).

It will default to displaying all results for the first page of search results.

Also documented in the help listing is '--' for end of parameters
and start of search or URLs.

Regards, Dallas E. Legan II / le...@acm.org / aw...@lafn.org
http://isthereanotherquestion.blogspot.com
************************************************************************
"Tekeli-li! Tekeli-li!"
        - "At the Mountains of Madness", H.P. Lovecraft

EXPLINATION



cd   /usr/bin/   ;

patch  -b   get_flash_videos   <<GFV1
56a57,58
> Getopt::Long::Configure ("bundling_override");   #  4 single char switches case sensitive - d.e.l.
> 
75a78
>   $player =~ s/%p/%s/    ; #  to allow an alternative to the overworked '%s'   - d.e.l.
88c91,93
<     info => 0
---
>     info => 0,
>     first => 100,
>     page => 1
118a124,126
>   -P --Page       Display page M of search results. (default: 1 (first)) (one page = 100 results).
>   -F --First      Display first N search results from page. (default/maximum: 100).
>   --              End of options.
145,158c153,168
<   "yes|y"        => \$opt{yes},
<   "filename|f=s" => \$opt{filename},
<   "version|v"    => \$opt{version},
<   "update|u"     => \$opt{update},
<   "help|h"       => \$opt{help},
<   "play|p"       => \$opt{play},
<   "player=s"     => \$opt{player},
<   "proxy=s"      => \$opt{proxy},
<   "debug|d"      => \$opt{debug},
<   "quiet|q"      => \$opt{quiet},
<   "add-plugin=s" => \$opt{add_plugin},
<   "quality|r=s"  => \$opt{quality},
<   "subtitles"    => \$opt{subtitles},
<   "info|i"       => \$opt{info},
---
>   "yes|y|Y"        => \$opt{yes},
>   "filename|f=s"   => \$opt{filename},
>   "version|v|V"    => \$opt{version},
>   "update|u|U"     => \$opt{update},
>   "help|h|H"       => \$opt{help},
>   "play|p"         => \$opt{play},
>   "player=s"       => \$opt{player},
>   "proxy=s"        => \$opt{proxy},
>   "debug|d|D"      => \$opt{debug},
>   "quiet|q|Q"      => \$opt{quiet},
>   "add-plugin=s"   => \$opt{add_plugin},
>   "quality|r|R=s"  => \$opt{quality},
>   "subtitles"      => \$opt{subtitles},
>   "info|i|I"       => \$opt{info},
>   "first|F=i"      => \$opt{first},
>   "page|P=i"       => \$opt{page},
169a180,182
> my $first  = abs $opt{first};
> my $page   = abs $opt{page};
> $page      =  ($page>0)?$page:1;
203c216
<   if (my @results = FlashVideo::Search->search($search, 10, 20)) {
---
>   if (my @results = FlashVideo::Search->search($search, $first, 200, $page)) {
GFV1



cd   /usr/share/perl5/FlashVideo/   ;

patch  -b       Search.pm    <<GFV2
12c12
<   my ($class, $search, $max_per_site, $max_results) = @_;
---
>   my ($class, $search, $max_per_site, $max_results, $page) = @_;
57c57
<   my @results = map { search_site($_, $search, "all", $max_per_site) } @search_sites;
---
>   my @results = map { search_site($_, $search, "all", $max_per_site, $page) } @search_sites;
66c66
<   my($search_site, $search, $type, $max) = @_;
---
>   my($search_site, $search, $type, $max, $page) = @_;
70c70
<   if (my @site_results = eval { $search_site->search($search, $type) }) {
---
>   if (my @site_results = eval { $search_site->search($search, $type, $page) }) {
GFV2


cd   /usr/share/perl5/FlashVideo/Site/  ;

patch -b   Googlevideosearch.pm    <<GFV3
10c10,12
<   my($self, $search, $type) = @_;
---
>   my $googlevideomax  = 100;           #  This is a fundamental constant for Google search
>                                        #  the maximum number of results per page 
>   my($self, $search, $type, $page) = @_;
11a14
>   $page = ($page - 1) * $googlevideomax;
16c19
<   $browser->get('http://video.google.com/videoadvancedsearch');
---
>   $browser->get('http://www.google.com/videohp');
25a29,36
> 
> #       This seems like an easy way to reuse whatever defaults the basic search uses
> #       in the future may allow adding settings page first - d.e.l.
> #       If more commands to issue during the search are instigated,
> #       reusing the session key / hash may be desirable.  - d.e.l.
>   $browser->get( $browser->base() . "&num=$googlevideomax&start=$page" )  ;
> #       Google allows amounts of 1, 10, 20, 30, 50, 100
> 
33a45,48
> 
> 
> for my $i ( reverse 0..$#links )
>   { splice @links, $i, 1  if $links[$i]{name} =~ /[[:^ascii:]]/  }
GFV3

Reply via email to