pzhlkj6612 / streamlink-plugins

custom streamlink plugins. also see https://github.com/pmrowla/streamlink-plugins
BSD 2-Clause "Simplified" License
0 stars 1 forks source link

[streamlink question] Unable to open URL xxx (400 Client Error: Bad Request) #1

Closed nazhendenb closed 1 year ago

nazhendenb commented 1 year ago
python -m streamlink https://nicochannel.jp/nekuro-asmr/video/smC69EkmRK7NLej4eWNnSj6F best -o test.ts
[cli][info] Found matching plugin niconicochannelplus for URL https://nicochannel.jp/nekuro-asmr/video/smC69EkmRK7NLej4eWNnSj6F
error: Unable to open URL: https://nfc-api.nicochannel.jp/fc/video_pages/smC69EkmRK7NLej4eWNnSj6F (400 Client Error: Bad Request for url: https://nfc-api.nicochannel.jp/fc/video_pages/smC69EkmRK7NLej4eWNnSj6F)

I'm sorry for opening an issue here. Because I do not know how to open new issue in your streamlink repo.

The script can work yesterday but today can not work. Then I tried GET https://nfc-api.nicochannel.jp/fc/fanclub_sites/{channel_number}/video_pages?vod_type=0&page=1&sort=-released_at&per_page=100 in Python.
The response data is {"error":{"message":{"fc_use_device":"MSGCM002"},"details":null,"debug_information":null}}. I also tried on another machine and the results are same. It may be the NicoNicoChannelPlus offical changed someting. But it can still get index.m3u8 in browser console.

nazhendenb commented 1 year ago

After test, add fc_use_device in http header can fix this problem.

"python","-m","streamlink","--http-header","fc_use_device=null","--http-header","user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",url,"best","-o",file_name,]

pzhlkj6612 commented 1 year ago

Good evening!

I'm sorry for opening an issue here. Because I do not know how to open new issue in your streamlink repo.

Is there a way to add issues to a github forked repo (without modifying the original)? - Stack Overflow

The script can work yesterday but today can not work. Then I tried GET https://nfc-api.nicochannel.jp/fc/fanclub_sites/{channel_number}/video_pages?vod_type=0&page=1&sort=-released_at&per_page=100 in Python. The response data is {"error":{"message":{"fc_use_device":"MSGCM002"},"details":null,"debug_information":null}}. I also tried on another machine and the results are same. It may be the NicoNicoChannelPlus offical changed someting. But it can still get index.m3u8 in browser console.

Yes, the website has indeed changed something:

>curl "https://nfc-api.nicochannel.jp/fc/video_pages/smC69EkmRK7NLej4eWNnSj6F"
{"error":{"message":{"fc_use_device":"MSGCM002"},"details":null,"debug_information":null}}

>curl "https://nfc-api.nicochannel.jp/fc/video_pages/smC69EkmRK7NLej4eWNnSj6F" -H "fc_use_device: null"
{"data":{"video_page":{...

I'll add this header later and let you know.

pzhlkj6612 commented 1 year ago

After test, add fc_use_device in http header can fix this problem.

"python","-m","streamlink","--http-header","fc_use_device=null","--http-header","user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",url,"best","-o",file_name,]

Nice work.

pzhlkj6612 commented 1 year ago

@railannad , please checkout 75bbaedc4399b733c1ef4ebaf4ae10f0221f1d25 and give it a try.

nazhendenb commented 1 year ago

@railannad , please checkout 75bbaed and give it a try.

Good morning. It can work normally. Thank you

pzhlkj6612 commented 1 year ago

OK.

nazhendenb commented 1 year ago

OK.

good morning @pzhlkj6612 Unfortunatelly the script can not work now. May be they did something.

error: Unable to open URL: https://nfc-api.nicochannel.jp/fc/video_pages/smopKrkmzzwPrVCEyNUn5pEL/session_ids (400 Client Error: Bad Request for url: https://nfc-api.nicochannel.jp/fc/video_pages/smopKrkmzzwPrVCEyNUn5pEL/session_ids)

pzhlkj6612 commented 1 year ago

I'll take a look.

pzhlkj6612 commented 1 year ago

@railannad please try 2940d14c271be26bbd55c36d61e16d9a53c4c530 .

nazhendenb commented 1 year ago

@railannad please try 2940d14 .

thank you @pzhlkj6612
It can work now.