spaam / svtplay-dl

Small command-line program to download videos from some streaming sites.
https://svtplay-dl.se
MIT License
718 stars 120 forks source link

NRK: 403 Forbidden When Trying to Find the M3U8 File for "List Quality" #1045

Open felsokning opened 5 years ago

felsokning commented 5 years ago

svtplay-dl versions:

svtplay-dl --version
svtplay-dl 2.1

Operating system and Python version:

OS: Ubuntu 18.04LTS Python:

python --version
Python 2.7.15rc1

python3 --version
Python 3.6.7

What is the issue:

It seems that svtplay-dl tries to download m3u8 file and gets a 403 - Forbidden. svtplay-dl suggests that geoblocking is the issue. I can watch the video in Firefox and download it via youtube-dl, so the issue seems specific to svtplay-dl. It will probably require spoofing the user-agent to get around but that doesn't seem to be a viable switch parameter in svtplay-dl.

svtplay-dl --list-quality --verbose https://tv.nrk.no/program/KMTE30000217/en-gang-aurora
DEBUG [1548662206.051382] /usr/lib/python3/dist-packages/svtplay_dl/utils/getmedia.py/get_media: version: 2.1
DEBUG [1548662206.0521839] /usr/lib/python3/dist-packages/svtplay_dl/service/__init__.py/__init__: service: nrk
DEBUG [1548662206.052234] /usr/lib/python3/dist-packages/svtplay_dl/utils/http.py/request: HTTP getting 'https://tv.nrk.no/program/KMTE30000217/en-gang-aurora'
DEBUG [1548662206.053541] /usr/lib/python3/dist-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): tv.nrk.no
DEBUG [1548662206.836673] /usr/lib/python3/dist-packages/urllib3/connectionpool.py/_make_request: https://tv.nrk.no:443 "GET /program/KMTE30000217/en-gang-aurora HTTP/1.1" 200 12801
DEBUG [1548662206.844061] /usr/lib/python3/dist-packages/svtplay_dl/utils/http.py/request: HTTP getting 'https://psapi-we.nrk.no//mediaelement/KMTE30000217'
DEBUG [1548662206.8480053] /usr/lib/python3/dist-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): psapi-we.nrk.no
DEBUG [1548662207.6253293] /usr/lib/python3/dist-packages/urllib3/connectionpool.py/_make_request: https://psapi-we.nrk.no:443 "GET //mediaelement/KMTE30000217 HTTP/1.1" 200 1358
DEBUG [1548662207.6288507] /usr/lib/python3/dist-packages/svtplay_dl/utils/http.py/request: HTTP getting 'http://nordond37b-f.akamaihd.net/i/no/open/ps/km/kmte30000217/kmte30000217aa/kmte30000217aa_,141,316,563,1266,2250,.mp4.csmil/master.m3u8'
DEBUG [1548662207.6331055] /usr/lib/python3/dist-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTP connection (1): nordond37b-f.akamaihd.net
DEBUG [1548662208.0014079] /usr/lib/python3/dist-packages/urllib3/connectionpool.py/_make_request: http://nordond37b-f.akamaihd.net:80 "GET /i/no/open/ps/km/kmte30000217/kmte30000217aa/kmte30000217aa_,141,316,563,1266,2250,.mp4.csmil/master.m3u8 HTTP/1.1" 403 453
ERROR [1548662208.003499] /usr/lib/python3/dist-packages/svtplay_dl/utils/getmedia.py/get_one_media: No videos found. Can't fetch the video because of geoblocking

Proof of Other Tool Working

youtube-dl --all-subs --merge-output-format mp4 --write-thumbnail --rm-cache-dir https://tv.nrk.no/program/KMTE30000217/en-gang-aurora
[NRKTV] KMTE30000217: Downloading mediaelement JSON
[NRKTV] KMTE30000217: Downloading f4m manifest
[NRKTV] KMTE30000217: Downloading m3u8 information
[download] Downloading playlist: En gang Aurora
[NRKTV] playlist En gang Aurora: Collected 1 video ids (downloading 1 of them)
[download] Downloading video 1 of 1
[info] Writing video subtitles to: En gang Aurora-KMTE30000217AA.no.ttml
[NRKTV] KMTE30000217AA: Downloading thumbnail ...
[NRKTV] KMTE30000217AA: Writing thumbnail to: En gang Aurora-KMTE30000217AA.jpg
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 314
[download] Destination: En gang Aurora-KMTE30000217AA.mp4
[download] 100% of 932.66MiB in 33:57
[ffmpeg] Fixing malformed AAC bitstream in "En gang Aurora-KMTE30000217AA.mp4"
[download] Finished downloading playlist: En gang Aurora
d33tah commented 5 years ago

You need a Norwegian IP to see this one. Try out ProtonVPN.

@edit: my bad, hadn't read all of your post.

Sopor commented 5 years ago

Have you tried svtplay-dl --http-header "X-FORWARDED-FOR=0.0.0.0" url? Replace 0.0.0.0 with a Norwegian IP (23.100.48.19).

felsokning commented 5 years ago

@d33tah - In the last code block, I proved I can access it. I'm coming from an IP address in Sweden and it isn't region-blocked for Sweden.

@Sopor - I'll give it a go but, as demonstrated in the last code block provided, it looks specific to svtplay-dl being blocked.

Sopor commented 5 years ago

image

felsokning commented 5 years ago

@Sopor- I can access the video just fine. Sweden is not region blocked from NRK, at least not for this specific video. image1

Sopor commented 5 years ago

@felsokning For me it is blocked as you can see in the above picture... Btw, my name is not SopoR, it is Sopor-.

felsokning commented 5 years ago

@Sopor- Right but the visible subtitles on the video playing proves that it's not blocked for me; which would indicate that it's not a geo-location blocking issue and the supporting evidence of the other program being able to download this specific video demonstrably contradicts that assumption, yeah?