Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Video - Nico Nico Douga" Extractor #79 #194

Merged
merged 3 commits into from
Apr 29, 2013

Conversation

syoichi
Copy link
Member

@syoichi syoichi commented Apr 28, 2013

#79 の問題を解決する為にニコニコ動画のExtractorを修正しました。
#95 でConstellationさんが示された、公式で提供されている外部プレーヤーのコード(script要素で外部プレーヤーを生成)、あるいはそのコードで使用されているJavaScriptをeval()で実行して得た情報を利用せず、ニコニコ動画におけるOpen Graph Protocolのmeta要素の情報(ニコニコ動画ログアウト時の動画ページのhead要素を参照)を参考にembed要素で外部プレーヤーを表示できようにしました。これにより、TumblrではDashboardでもTaberarelooで投稿されたVideoポストは外部プレーヤーで動画を視聴できるようになります。

また、#95 のYungSangさんのコードを参考にGoogle+へ投稿する際の対応も行なっています。こちらでは他のExtractorでもポストタイプの変換処理を適用できるようにしています。

この変更の動作は、Windows 7 Home Premium SP1 64bit上のChrome 26.0.1410.64、拡張のバージョンは2.0.79-dev( 17f1047 までの変更を含む)という環境で確認しています。

@YungSang
Copy link
Contributor

試しています。
http://www.nicovideo.jp/watch/sm20668566
このページで
event handler for 'undefined': Cannot read property 'src' of null TypeError: Cannot read property 'src' of null
エラーが出ています。
1272: ctx.document.querySelector('.videoThumbnailImage, .img_std128').src

@YungSang
Copy link
Contributor

もしかしたら Qバージョンってのにしないとなりませんか?

@YungSang
Copy link
Contributor

@syoichi が書かれている「ニコニコ動画ログアウト時の動画ページ」を取ってこれると Open Graph を使ってもっと簡単になりそうですね。
クッキーを送らないで request とか出来るんでしょうか?

@YungSang
Copy link
Contributor

強引ですけど、こんなのはどうでしょうか?
https://gist.github.com/YungSang/5476071

ちょっと強引過ぎますね。すみません。

@syoichi
Copy link
Member Author

syoichi commented Apr 28, 2013

検証して頂きありがとうございます。原宿バージョンへの対応などを行いました。
まだまだ考慮しきれていない部分があるかもしれません…。

@YungSang
Copy link
Contributor

ありがとうございます。こちらの環境(原宿バージョン)でも動きました。

@Constellation
Copy link
Member

ありがとうございます!! これなら大丈夫そうですね, merge します!

Constellation added a commit that referenced this pull request Apr 29, 2013
Fix "Video - Nico Nico Douga" Extractor #79
@Constellation Constellation merged commit 73388ca into taberareloo:master Apr 29, 2013
wantora pushed a commit to wantora/tombfix-core that referenced this pull request May 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants