Closed GoogleCodeExporter closed 9 years ago
I can reproduce the problem. Before saying the 302 response should be handled.
This is the url extracted by Ustream.pm, it maybe the site has been updated and
using an old method for extracting the url, resulting in the needed to redicted
to a new url. This needs some more investigation of the problem.
Original comment by njtaylor...@gmail.com
on 3 Mar 2013 at 2:16
I did hack redirect handling logic into FlashVideo::Downloader::download and it
appears to work so far. I tried non-ustream sites and they appear not to be
affected.
I have attached the hacked Downloader.pm as a reference, in case any project
member is interested in leveraging the logic. I am not proud of the logic. It
is basically a test for a 302 redirect return from the get, if the get returns
a redirect, the redirect location is assigned into $url and a goto is executed
to retry the get.
Original comment by pcwal...@comcast.net
on 3 Mar 2013 at 3:21
Attachments:
I had a look at this, and found allow-redirects. You might like to try this
slightly simpler change. Worked for me.
--- /usr/local/libdata/perl5/site_perl/FlashVideo/Site/Ustream.pm Thu Feb
21 23:02:57 2013
+++ Ustream.pm Sun Mar 3 18:48:24 2013
@@ -5,6 +5,9 @@
use FlashVideo::Utils;
use MIME::Base64;
+our $VERSION = '0.01';
+sub Version() { $VERSION };
+
sub find_video {
my ($self, $browser, $embed_url) = @_;
@@ -41,6 +44,8 @@
# Data::AMF fails to understand this response, so just parse ourselves.
my($flv_url) = $browser->content =~ /flv.{3,5}(http:[^\0]+)/;
+
+ $browser->allow_redirects;
return $flv_url, title_to_filename($title);
}
Place the attached Ustream.pm file in ~/.get_flash_videos/plugins (Unix/linux
os) or replace Ustream.pm to try.
Original comment by njtaylor...@gmail.com
on 4 Mar 2013 at 3:29
Attachments:
Thanks njtaylor, yes adding the $browser->allow_redirects to Ustream.pm works.
I was under the impression that redirects was ON, already and was not being
handled for some other reason.
If you want to submit the Ustream.pm patch to the main trunk, I'd appreciate it.
Original comment by pcwal...@comcast.net
on 4 Mar 2013 at 5:20
I will add this to my repository, will go in with my next pull request. I will
close this issue.
Original comment by njtaylor...@gmail.com
on 4 Mar 2013 at 6:13
This is now in the master repository, downloads files will be created shortly.
Original comment by njtaylor...@gmail.com
on 5 Mar 2013 at 1:00
Original issue reported on code.google.com by
pcwal...@comcast.net
on 2 Mar 2013 at 9:54