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
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2k
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
300
Ethereum_.pdf
nekomatu
0
370
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
280
RailsのPull requestsのレビューの時に私が考えていること
yahonda
5
2.7k
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
4
1.9k
現場で役立つモデリング 超入門
masuda220
PRO
15
3.1k
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
JavaでLチカしたい! / JJUG CCC 2024 Fall LT
nhayato
0
110
WEBエンジニア向けAI活用入門
sutetotanuki
0
330
CSC509 Lecture 09
javiergs
PRO
0
140
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
1.5k
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
65
4.4k
The Invisible Side of Design
smashingmag
297
50k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
15
2k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Docker and Python
trallard
40
3.1k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Producing Creativity
orderedlist
PRO
341
39k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
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?