Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
自家製オタクソリューションの紹介
Search
tondol
July 29, 2015
Programming
1
480
自家製オタクソリューションの紹介
Archive everything you want
tondol
July 29, 2015
Tweet
Share
More Decks by tondol
See All by tondol
ちいさく始めるレイヤードアーキテクチャ
tondol
7
1.8k
RxSwift 3.3.0: Observable のフレンズが増えました!!
tondol
2
2.4k
Amazon Cloud Driveのご紹介
tondol
0
470
ドはDockerのド
tondol
1
2.7k
Other Decks in Programming
See All in Programming
距離関数を極める! / SESSIONS 2024
gam0022
0
280
ヤプリ新卒SREの オンボーディング
masaki12
0
130
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Jakarta EE meets AI
ivargrimstad
0
140
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Better Code Design in PHP
afilina
PRO
0
120
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
現場で役立つモデリング 超入門
masuda220
PRO
15
3.2k
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
610
Realtime API 入門
riofujimon
0
150
Featured
See All Featured
Writing Fast Ruby
sferik
627
61k
Designing Experiences People Love
moore
138
23k
The Cult of Friendly URLs
andyhume
78
6k
The Invisible Side of Design
smashingmag
298
50k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
How to Ace a Technical Interview
jacobian
276
23k
Gamification - CAS2011
davidbonilla
80
5k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Unsuck your backbone
ammeep
668
57k
Happy Clients
brianwarren
98
6.7k
Transcript
W8LT#04 ࣗՈΦλΫιϦϡʔγϣϯͷհ @tondol 2015-07-29 (Wed.)
Self Introduction @tondol ܭࢉֶઐ߈M2 ˓˓ݚڀࣨ ˠˠେࡕˠౡˠ໊ݹˠ ˠʢΠϚίίʣˠࡳຈˠઋˠ • ୭͔50ສԁ͘Ε •
ࠓظͷϥϒϥΠϒʂ
Self Introduction @tondol ܭࢉֶઐ߈M2 ˓˓ݚڀࣨ ˠˠେࡕˠౡˠ໊ݹˠ ˠʢΠϚίίʣˠࡳຈˠઋˠ • ୭͔50ສԁ͘Ε •
ࠓظͷϥϒϥΠϒʂ
എܠ • ΦλΫଟ – ΠϕϯτࢀՃ – ΞϧόΠτ – ݚڀ – W8LTͷࢿྉ࡞ • ࡏίϯςϯπ – ΞχϝɾϥδΦɾχίੜ
– ϦΞϧλΠϜʹফԽͰ͖ͳ͍͜ͱ͋Δ – ظؒݶఆίϯςϯπͷݫ͠͞
Archive everything you want
͜ͷੈʹଘࡏ͢Δ͢ ͯͷظؒݶఆίϯςϯ πΛΞʔΧΠϒ͍ͨ͠
ఏҊ • NicoAnime – χίχίͷΞχϝνϟϯωϧΛొ – ֤Τϐιʔυ͕ࣗಈΞʔΧΠϒ͞ΕΔ • NicoKako –
ಛఆͷχίχίੜ์ૹΛొ – λΠϜγϑτػೳͰμϯϩʔυ • koeradi – ಛఆͷωοτϥδΦΛԻ • ֤αʔϏεͷنతʹ……ʁ
NicoAnime
֓ཁ • Ϣʔβʔ͕νϟϯωϧΛొ – ֤Ϋʔϧͷॳճ৴ظؒʹΔ • ఆظతʹcrawler͕ొಈըΛ֬ೝ – ߋ৽͕͋ΕDLϦετʹೖΕΔ • ఆظతʹdownloader͕ಈըΛDL – DLϦετʹ͋ΔͷΛΞʔΧΠϒ͢Δ
• Ϣʔβʔͷૢ࡞ΣϒͰ݁ – ಈըͷ࠶ੜɾϩʔΧϧͷDLՄೳ
σϞ
ߏ crawler (Ruby) downloader (Ruby) Niconico Live DB (MySQL) frontend
(PHP) file system crontab nginx, php-fpm
ٕज़తৄࡉ(1) • NiconicoͷϩάΠϯ – secure.nicovideo.jp/secure/login – ্هʹIDͱύεϫʔυΛPOST͢Δ – Ϩεϙϯεͷset-cookieϔομ͔Β user_sessionΛऔಘ͠هԱ͢Δ • getflv/getthumbinfo – ಈըϝλσʔλΛऔಘ͢ΔAPI
– user_sessionΛcookieͰૹ৴ͭͭ͠get – GETύϥϝʔλ/XMLϑΥʔϚοτ
ٕज़తৄࡉ(2) • watch – user_sessionΛcookieͰૹ৴ͭͭ͠GET – Ϩεϙϯεͷset-cookieϔομ͔Β historyΛऔಘ͠هԱ͢Δ • μϯϩʔυ – user_session, historyΛcookieͰૹ৴ͭͭ͠
getflvͰऔಘͨ͠ಈըURLΛGET
ิ • Niconico APIʹؔ͢Δৄࡉ – https://github.com/tondol/NicoVideo • ࿈ଓ࠶ੜ੍ݶͱ͔ը࣭ͱ͔ ϓϨϛΞϜ͡Όͳ͍ͱΩπ͍ͱࢥ͏ – ݄500ԁޡࠩ
NicoKako
֓ཁ • Ϣʔβʔ͕χίχίੜ์ૹΛొ – λΠϜγϑτՄೳظؒʹΔ – DLϦετʹՃ͞ΕΔ • ఆظతʹdownloader͕ಈըΛDL – DLϦετʹ͋ΔͷΛΞʔΧΠϒ͢Δ • Ϣʔβʔͷૢ࡞ΣϒͰ݁
– ಈըͷ࠶ੜɾϩʔΧϧͷDLՄೳ – λΠϜγϑτ༧ཧػೳ
σϞ
ߏ downloader (Ruby) Niconico Live DB (MySQL) frontend (PHP) file
system crontab nginx, php-fpm
ٕज़తৄࡉ(1) • NiconicoͷϩάΠϯ – লུ • getplayerstatus – χίੜͷϝλσʔλΛऔಘ͢ΔAPI – user_sessionΛcookieͰૹ৴ͭͭ͠GET – XMLϑΥʔϚοτ – λΠϜγϑτDLʹඞཁͳύϥϝʔλͳͲ
ٕज़తৄࡉ(2) • λΠϜγϑτDL – rtmpeϓϩτίϧͰͷ৴ – getplayerstatusͷϨεϙϯεΛݩʹDLʹඞཁͳ ύϥϝʔλΛߏ͢Δ – ύϥϝʔλΛrtmpdumpʹ͢
– DLঢ়گ͕100%ʹͳΔ·ͰϨδϡʔϜ • ҙ – ظݶΕͷੜ์ૹDLෆՄ – ՝ۚࡁΈͳΒ༗ྉੜ์ૹಉ͡ํ๏ͰDLՄೳ
ิ • λΠϜγϑτDLʹؔ͢Δৄࡉ – https://gist.github.com/tondol/7039259 • λΠϜγϑτ༧ͷ্ݶͱ͔λΠϛϯά ͱ͔ϓϨϛΞϜ͡Όͳ͍ͱΩπ͍ͱࢥ͏ – ݄500ԁޡࠩ
koeradi
֓ཁ • ωοτϥδΦΛDL͢ΔεΫϦϓτ܊ – ରԠہɿ A&GɾڹɾϦεϥδɾradikoɾϫϩοϓ – ؆қWeb UIΛඋ͑Δ • Ի͍ͨ͠์ૹຖʹcrontabʹهड़ – ִि৴ͱ͔໘͔ͩΒඇରԠ
– ݱࡏ14ϓϩάϥϜ/ि΄ͲΞʔΧΠϒӡ༻த
σϞ
ߏ downloader(s) (Ruby/bash) net radio server(s) frontend (PHP) file system
crontab nginx, php-fpm
ٕज़తৄࡉ • ༻πʔϧ – rtmpdump/ffmpeg/swftools – rtmpdump: rtmpϓϩτίϧʹΑΔDL – ffmpeg: HLSϓϩτίϧʹΑΔDL, ม – swftools:
radikoͷpartialkeyऔಘ༻ • εΫϦϓτ – RubyͩͬͨΓbashͩͬͨΓ – ઃఆϑΝΠϧdotenvʹهड़
ิ • radikoʹؔ͢Δৄࡉ – http://kyoshiaki.hatenablog.com/entry/ 2014/05/04/184748 • ํͷϥδΦΛฉ͘ͳΒ radikoϓϨϛΞϜΛܖ͠·͠ΐ͏ – ݄300ԁޡࠩ
NicoAnime NicoKako koeradi
Q and A?