Permalink
Browse files

Fixed nicovideo embed

  • Loading branch information...
ysasaki committed Oct 23, 2011
1 parent bc72fb8 commit 8615c7199555c028b3a9c09cec00cade7fc65079
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Remedie/Server/RPC/Player.pm
@@ -42,8 +42,10 @@ sub nicovideo : POST {
## Whoa HACK
my $code = $response->content;
$code =~ s/document\.write\((.*?)\)/\$("#embed-player").html($1)/g;
$code =~ s/(wv_title.*?)$/$1\n, fv_autoplay: 1, fv_new_window: true/m
or die "This video is deleted or does not allow embeds";
$code =~ s/(wv_id.*?)$/$1\n, 'fv_autoplay': '1', 'fv_new_window': 'true'/m;
if ( $code =~ /isDeleted: true/ ) {
die "This video is deleted or does not allow embeds";
}
return { success => 1, code => $code };
}

0 comments on commit 8615c71

Please sign in to comment.