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
flutterkaigi_2024.pdf
kyoheig3
0
150
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
React への依存を最小にするフロントエンド設計
takonda
4
810
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
距離関数を極める! / SESSIONS 2024
gam0022
0
290
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.2k
Quine, Polyglot, 良いコード
qnighy
4
650
受け取る人から提供する人になるということ
little_rubyist
0
250
RubyLSPのマルチバイト文字対応
notfounds
0
120
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
Functional Event Sourcing using Sekiban
tomohisa
0
100
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
65
11k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Writing Fast Ruby
sferik
627
61k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Facilitating Awesome Meetings
lara
50
6.1k
Git: the NoSQL Database
bkeepers
PRO
427
64k
BBQ
matthewcrist
85
9.3k
Ruby is Unlike a Banana
tanoku
97
11k
Navigating Team Friction
lara
183
14k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
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?