pantiweara / get-flash-videos

Automatically exported from code.google.com/p/get-flash-videos
0 stars 0 forks source link

The search function is broken #552

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. trying to conduct a search fails.

What is the expected output? What do you see instead?

The expected output is a menu of videos to download.
Instead an error message is printed to the screen.

What version of the product are you using? On what operating system?

According to the source code I'm using version 1.25.
The computer OS is Debian Linux Testing.

Please provide any additional information below.

I expect to submit two patches to fix some search related
problems soon, this is just a formality to get them in the 
code base.

I've done this for a blind friend who prefers using get_flash_videos
to search for videos to listen to.

The first patch, for Googlevideosearch.pm fixes the basic search feature,
and also throws out bogus duplicate URLs generated by the way
Google video search formats it's output.
These show up as 'hidden links' on the Lynx text browser, 
I think they go with the thumbnails in graphical browsers, and lack
any title.
For someone using a screen reader, they almost certainly represent static.

The other patch, to the basic program 'get_flash_video',
 boosts the results returned to close to 100.

I haven't done any work yet on changing the interface to allow selecting
between Googles choices on number of results returned.

I don't know what the drift is on supporting YouTube in this project,
but with YouTube somewhere on the way to phasing out flash if they
haven't already completely done so, it seems like YT falls outside
the scope of the project.  In that case it might be desirable
to automaticly include a '-site:youtube.com'  with the searches,
so more of the results will be pertinent.
In short, I haven't heard of the get_html5_videos project yet.  :-)

If the program fails to download a video after a search, it crashes.
something probably needs to be done about that.

My changes are probably ugly and crude to more experienced perl
coders, I basicly use perl when shell and other tools I use 
don't fit the job and perl does.

Regards,
Dallas E. Legan II
legan@acm.org / aw585@lafn.org / http://www.lafn.org/~aw585/index.html

Original issue reported on code.google.com by dallas.l...@gmail.com on 11 Jan 2014 at 8:50

GoogleCodeExporter commented 8 years ago
Sorry if I'm to clumsy in getting this stuff out, feel free to 
suggest better practice.

Regards,
Dallas E. Legan II
legan@acm.org / aw585@lafn.org / http://www.lafn.org/~aw585/index.html

--

Patch to fix video search (for Googlevideosearch.pm):

16c16
<   $browser->get('http://video.google.com/videoadvancedsearch');
---
>   $browser->get('http://www.google.com/videohp');
25a26,30
> 
> #       this seems like an easy way to reuse whatever defaults the basic 
search uses - d.e.l.
>   $browser->get( $browser->base() . '&num=100' )  ;
>         #  Google allows amounts of 10, 20, 30, 50, 100
> 
33c38,41
<               $browser->find_all_links(text_regex => qr/.+/, url_regex => 
qr/\/url/);
---
>               $browser->find_all_links(text_regex => qr/[:print:]+/, 
url_regex => qr/\/url/);
> 
> for my $i ( reverse 0..$#links ) 
>   { splice @links, $i, 1  if $links[$i]{name} =~ /[[:^ascii:]]/  } 

--
Patch to max out number of search results (for get_flash_videos):

203c203
<   if (my @results = FlashVideo::Search->search($search, 10, 20)) {
---
>   if (my @results = FlashVideo::Search->search($search, 100, 200)) {

Original comment by dallas.l...@gmail.com on 11 Jan 2014 at 9:25

Attachments:

GoogleCodeExporter commented 8 years ago
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 / legan@acm.org / aw585@lafn.org
http://isthereanotherquestion.blogspot.com
************************************************************************
"Tekeli-li! Tekeli-li!"
        - "At the Mountains of Madness", H.P. Lovecraft

Original comment by dallas.l...@gmail.com on 22 Jan 2014 at 9:04

Attachments: