beyonthink / get-flash-videos

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

Not playing some videos at BBC News #169

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently I am not able to play any videos from BBC News in any browser in my 
computer, so I thought I would give this utility a go. I downloaded the latest 
version from the website.

I am running on MacOS X 10.6.4.

After installing all the required Perl modules I run, from the terminal:

$ ./get_flash_videos --debug 
http://www.bbc.co.uk/news/science-environment-11384614
No plugins installed
Downloading http://www.bbc.co.uk/news/science-environment-11384614
-> GET http://www.bbc.co.uk/news/science-environment-11384614
<- 200 text/html (58755)
Trying to open plugin ~/.get_flash_videos/plugins/Www.pm
Using method 'bbc' for http://www.bbc.co.uk/news/science-environment-11384614
Error: Couldn't find BBC XML playlist URL in 
http://www.bbc.co.uk/news/science-environment-11384614 at ./get_flash_videos 
line 988.

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: ./get_flash_videos --update

If the latest version does not support this please open a bug (or
contribute a patch!) at http://code.google.com/p/get-flash-videos/
make sure you include the output with --debug enabled.
Couldn't download any videos.

Original issue reported on code.google.com by andrejoh...@gmail.com on 24 Sep 2010 at 12:39

GoogleCodeExporter commented 8 years ago
Same problem on Linux( Ubuntu 10.4 updated).

$ get_flash_videos http://www.bbc.co.uk/news/world-europe-11698287 -d
No plugins installed
Downloading http://www.bbc.co.uk/news/world-europe-11698287
-> GET http://www.bbc.co.uk/news/world-europe-11698287
<- 200 text/html (60301): UTF8 on, ASCII, 60301 characters 60301 bytes
Trying to open plugin ~/.get_flash_videos/plugins/Www.pm
Using method 'bbc' for http://www.bbc.co.uk/news/world-europe-11698287
Error: Couldn't find BBC XML playlist URL in 
http://www.bbc.co.uk/news/world-europe-11698287 at /usr/bin/get_flash_videos 
line 988.

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: /usr/bin/get_flash_videos --update

If the latest version does not support this please open a bug (or
contribute a patch!) at http://code.google.com/p/get-flash-videos/
make sure you include the output with --debug enabled.
Couldn't download any videos.

Original comment by chese...@gmail.com on 20 Nov 2010 at 3:20

GoogleCodeExporter commented 8 years ago
There is a clue here 
https://bugs.launchpad.net/ubuntu/+source/get-flash-videos/+bug/1210314

It seems that depending on the age and location of the BBC page, the way that 
the playlist file is specified differs. Some trial and error based on above 
clue, I am now getting result using these 3 ways to capture the playlist 
information.

Since I can't get .pm plugins to work (and too lazy to work out why) I've made 
these changes directly in get_flash_videos-1.24 as per attached

###### code snippter
sub find_video {
  my ($self, $browser, $page_url) = @_;
  my $playlist_xml;
  if ($browser->content =~ /<param name="playlist" value="(http:.+?\.xml)"/) {
    $playlist_xml = $1;
    info "bbc-option1";
  }
 elsif ($browser->content =~ /"href":"(http:[^"]+?playlist\.s?xml)"/) {
 info "bbc-option2";
 $playlist_xml = $1;
 $playlist_xml =~ s/\\//g;
    info $playlist_xml;
 }
  elsif ($browser->content =~ /(http:[^":]+?playlist\.s?xml)/) {
 info "bbc-option3";
    $playlist_xml = $1;
    $playlist_xml =~ s/\\//g;
    info $playlist_xml;
  }

Original comment by luitevan...@gmail.com on 1 Sep 2013 at 4:06

Attachments:

GoogleCodeExporter commented 8 years ago
Noted problem replicated with current version, however the version being 
reported against is out of date. Patches should be against current git version. 
The attachment is for the combined version, this is generated code.

Added patch

--- get-flash-videos/lib/FlashVideo/Site/Bbc.pm   Fri Apr  5 10:34:14 2013
+++ Bbc.pm      Mon Sep  2 00:21:02 2013
@@ -5,6 +5,9 @@
 use FlashVideo::Utils;
 use URI;

+our $VERSION = '0.01';
+sub Version() {$VERSION;}
+
 sub find_video {
   my ($self, $browser, $page_url, $prefs) = @_;

@@ -17,6 +20,14 @@
   my $playlist_xml;
   if ($browser->content =~ /<param name="playlist" value="(http:.+?\.s?xml)"/) {
     $playlist_xml = $1;
+  }
+  elsif ($browser->content =~ /"href":"(http:[^"]+?playlist\.s?xml)"/) {
+    $playlist_xml = $1;
+    $playlist_xml =~s/\\//g;
+  }
+  elsif ($browser->content =~ /(http:[^":]+?playlist\.s?xml)/) {
+    $playlist_xml = $1;
+    $playlist_xml =~ s/\\//g;
   }
   elsif($browser->content =~ /empDivReady\s*\(([^)]+)/) {
     my @params = split /,\s*/, $1;

Tried the example download...

$ get_flash_videos http://www.bbc.co.uk/news/uk-23626232               
Using method 'bbc' plugin version 0.01 for http://www.bbc.co.uk/news/uk-23626232
Downloading http://www.bbc.co.uk/news/uk-23626232
Downloading 
http://news.downloads.bbc.co.uk.edgesuite.net/mps_h264_hi/public/news/uk/1001000
/1001225_h264_1500k.mp4?at=2ZXn3ctI258ba8ca036edf36b261bd2bfac0ab08424f71664e55a
b74df700...
1001225_h264_1500k.mp4: 19% (4307.31 / 22667.88 KiB)^C

That appears to be working. Needs more testing before it goes into git.

Original comment by njtaylor...@gmail.com on 1 Sep 2013 at 11:41

GoogleCodeExporter commented 8 years ago
Put into git repository https://github.com/njtaylor/get-flash-videos

Original comment by njtaylor...@gmail.com on 3 Sep 2013 at 10:22