Skip to content

Commit

Permalink
Apply patch from issue 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurvideo committed May 29, 2009
1 parent 9e75693 commit 30864f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion FlashVideo/Site/Youku.pm
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,14 @@ JSON structure:
die "Youku rejected our attempt to get the video, we're probably out of date"
unless $browser->response->code eq 302 and $url;

# Sometimes, for whatever reason, the location we get back is missing
# the file extension
debug "Video location is $url";
$url = "$url.$stream" unless $url =~ /$stream$/;

# Video title is in escaped unicode format
my ( $title ) = ( $json =~ /"title":"([^"]+)"/ );
$title =~ s/\\u([a-f0-9]+)/chr(hex $1)/egi;
$title =~ s/\\u([a-f0-9]{4})/chr(hex $1)/egi;

# Use the video title as the filename when available
my $filename = get_video_filename( $stream );
Expand Down

0 comments on commit 30864f7

Please sign in to comment.