Skip to content

plugins.nicolive: fix mfa login #6378

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

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

Mehavoid
Copy link
Contributor

@Mehavoid Mehavoid commented Jan 3, 2025

@bastimeyer bastimeyer added plugin issue A Plugin does not work correctly restriction: account needed labels Jan 3, 2025
@bastimeyer bastimeyer mentioned this pull request Jan 4, 2025
5 tasks
@bastimeyer
Copy link
Member

@Mehavoid could you please post a debug log that proves that the login is indeed working with your changes? Then I would be able to merge this. Thanks!

@Mehavoid
Copy link
Contributor Author

Mehavoid commented Jan 6, 2025

$ streamlink -l debug -o /dev/null --niconico-email PASS --niconico-password PASS https://live.nicovideo.jp/watch/lv346721124 best
[cli][debug] OS:         Linux-5.4.0-196-generic-x86_64-with-glibc2.31
[cli][debug] Python:     3.9.5
[cli][debug] OpenSSL:    OpenSSL 1.1.1f  31 Mar 2020
[cli][debug] Streamlink: 7.1.1+6.gb2dada19
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.12.14
[cli][debug]  exceptiongroup: 1.1.1
[cli][debug]  isodate: 0.6.0
[cli][debug]  lxml: 4.7.1
[cli][debug]  pycountry: 22.1.10
[cli][debug]  pycryptodome: 3.9.9
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.31.0
[cli][debug]  trio: 0.22.2
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  urllib3: 2.0.6
[cli][debug]  websocket-client: 1.2.3
[cli][debug] Arguments:
[cli][debug]  url=https://live.nicovideo.jp/watch/lv346721124
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --output=/dev/null
[cli][debug]  --retry-max=40
[cli][debug]  --stream-segment-threads=1
[cli][debug]  --hls-playlist-reload-attempts=1
[cli][debug]  --ffmpeg-no-validation=True
[cli][debug]  --niconico-email=********
[cli][debug]  --niconico-password=********
[cli][info] Found matching plugin nicolive for URL https://live.nicovideo.jp/watch/lv346721124
[plugins.nicolive][info] Logging in via provided email and password
Enter the 6 digit number included in email: 141196
[plugins.nicolive][debug] Cookies: {'mfa_session': '136463518_NYsNIj45456KFcG70xQ3CNsOst6N', 'nicosid': '1736535622.1565253', 'user_session': 'user_session_1325345618_9d1f1d43940510515fe295bcdd5281eff4a178bc4dabeb654441b6021cab13a', 'user_session_secure': 'MTM3ODk5NzEle43kRWxneTM3cDZvT2E2Ug5fbanBnbXZWR3Fjd1JVSnZjT2hmOGtJLmk', 'mfa_trusted_device_token': 'eyJhbfciOiJkaXIiLCg45MiOiJBMTI4Q0JD65h2jU2In0..OUh0EfnjG19sp8rGGxDKdg.IWn9fkTUIqGDhu4OhURPF125FmmDvTstMsLLvsMg2XulArwJcN8efPS1N3tfht-2V-_p-0GywCgXvW7mFw66bWv18Sq_ISwsvSyxdsvdeCeFjo9EyXNqOmAlSAkqx8LCLCZ58k4ElT_AtrU28wetjVFJeL1Oq9HEvJE_N6JPOLqywWjGXHnHhdGK0Lj2dqiY.Ft6_CjcSd004VxSopcGPVw'}
[plugins.nicolive][info] Logged in.
[plugins.nicolive][debug] Saved cookies: mfa_session, nicosid, user_session, user_session_secure, mfa_trusted_device_token
[plugin.api.websocket][debug] Connecting to: wss://a.live2.nicovideo.jp/unama/wsapi/v2/watch/68605217604170?audience_token=68605217604170_137899718_1736280031_0d4c7bdd4fb081545054951cbc98c317025ca45e&frontend_id=9
[plugins.nicolive][debug] Waiting for permit (for at most 6 seconds)...
[plugin.api.websocket][debug] Connected: wss://a.live2.nicovideo.jp/unama/wsapi/v2/watch/68605217604170?audience_token=68605217604170_137899718_1736280031_0d4c7bdd4fb081545054951cbc98c317025ca45e&frontend_id=9
[plugins.nicolive][debug] Received: {"type":"serverTime","data":{"currentMs":"2025-01-07T05:00:33.542+09:00"}}
[plugins.nicolive][debug] Received: {"type":"seat","data":{"keepIntervalSec":30}}
[plugins.nicolive][debug] Received: {"type":"stream","data":{"uri":"https://vodedge632.dmc.nico/hlslive/ht2_nicolive/nicolive-production-pg68605217604170_cc8094cafcc6a86a5904f7566f3fb8fc4dae4f8896cc767a797df5625c7c3adf/master.m3u8?ht2_nicolive=137899718.00sh4p56qq_sponkx_3vgifkytj38b2","syncUri":"https://vodedge632.dmc.nico/hlslive/ht2_nicolive/nicolive-production-pg68605217604170_cc8094cafcc6a86a5904f7566f3fb8fc4dae4f8896cc767a797df5625c7c3adf/stream_sync.json?ht2_nicolive=137899718.00sh4p56qq_sponkx_3vgifkytj38b2","quality":"abr","availableQualities":["abr","super_high","high","normal","low","super_low","audio_high","audio_only"],"protocol":"hls"}}
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 350k (worst), 690k, 1800k, 3600k, 5400k (best)
[cli][info] Opening stream: 5400k (hls)
[cli][info] Writing output to
/dev/null
[cli][debug] Checking file output
[plugins.nicolive][debug] Stream opened, keeping websocket connection alive
[plugins.nicolive][debug] Received: {"type":"schedule","data":{"begin":"2025-01-07T04:04:49+09:00","end":"2025-01-07T05:34:49+09:00"}}
[plugins.nicolive][debug] Received: {"type":"messageServer","data":{"viewUri":"https://mpn.live.nicovideo.jp/api/view/v4/BBxK6YDUn6sPr-AqLvSvGcNaImV9vGFuyGav9Sg2Gfn3y79Tyz0M8YXelrjZUJtnu3UZHtgaZKE","vposBaseTime":"2025-01-07T04:04:31+09:00","hashedUserId":"a:K5h3M_D4g2sauxXo"}}
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[plugins.nicolive][debug] Received: {"type":"akashic","data":{"playId":"99224152","contentUrl":"https://ak.cdn.nimg.jp/coe/contents/aufeiR7C/nicocas/4.2.2.6/content.json","logServerUrl":"wss://msg33.akashic.coe.nicovideo.jp/4004/","status":"ready","token":"c370b534b40b5568201270ca9a720d0867d86ff9b09242a0a663aa591fe","playerId":"137899718"}}
[plugins.nicolive][debug] Received: {"type":"statistics","data":{"viewers":149,"comments":76,"adPoints":2000,"giftPoints":0}}
[stream.hls][debug] First Sequence: 2236; Last Sequence: 2238
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 2236; End Sequence: None
[stream.hls][debug] Adding segment 2236 to queue
[stream.hls][debug] Adding segment 2237 to queue
[stream.hls][debug] Adding segment 2238 to queue
[stream.hls][debug] Reloading playlist
[stream.hls][debug] Writing segment 2236 to output
[stream.hls][debug] Segment 2236 complete
[cli][debug] Writing stream to output
[download] Written 557.20 KiB to /dev/null (0s)                                                                                                              [stream.hls][debug] Writing segment 2237 to output
[stream.hls][debug] Segment 2237 complete
[download] Written 1.11 MiB to /dev/null (0s)                                                                                                                [stream.hls][debug] Writing segment 2238 to output
[stream.hls][debug] Segment 2238 complete
[stream.hls][debug] Adding segment 2239 to queue
[stream.hls][debug] Adding segment 2240 to queue
[download] Written 1.66 MiB to /dev/null (1s)                                                                                                                [stream.hls][debug] Reloading playlist
[download] Written 1.66 MiB to /dev/null (2s @ 756.85 KiB/s)                                                                                                 [stream.hls][debug] Writing segment 2239 to output
[stream.hls][debug] Segment 2239 complete
[download] Written 2.25 MiB to /dev/null (2s @ 921.76 KiB/s)                                                                                                 [stream.hls][debug] Reloading playlist
[download] Written 2.25 MiB to /dev/null (3s @ 837.96 KiB/s)                                                                                                 [stream.hls][debug] Writing segment 2240 to output
[stream.hls][debug] Segment 2240 complete
[stream.hls][debug] Adding segment 2241 to queue
[download] Written 2.79 MiB to /dev/null (4s @ 762.65 KiB/s)                                                                                                 [stream.hls][debug] Writing segment 2241 to output
[stream.hls][debug] Segment 2241 complete
[download] Written 3.37 MiB to /dev/null (4s @ 766.24 KiB/s)                                                                                                 [stream.hls][debug] Reloading playlist
[download] Written 3.37 MiB to /dev/null (5s @ 725.91 KiB/s)                                                                                                 [stream.hls][debug] Adding segment 2242 to queue
[download] Written 3.37 MiB to /dev/null (5s @ 626.92 KiB/s)                                                                                                 [download] Written 3.37 MiB to /dev/null (5s @ 611.99 KiB/s)
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[stream.hls][debug] Writing segment 2242 to output
[stream.hls][debug] Segment 2242 complete
[plugin.api.websocket][debug] Closed: wss://a.live2.nicovideo.jp/unama/wsapi/v2/watch/68605217604170?audience_token=685252357604170_137899718_1736280031_0d4c5bdd4f308154505524fcbc98c317025ca45e&frontend_id=9
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...

@bastimeyer bastimeyer merged commit ec30251 into streamlink:master Jan 6, 2025
23 checks passed
@bastimeyer
Copy link
Member

Thanks

@Mehavoid Mehavoid deleted the plugins/nicolive/fix-mfa branch January 6, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin issue A Plugin does not work correctly restriction: account needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plugins.nicolive: unable to login
2 participants