Skip to content

plugins.nos: update matcher, fix validation schema #6420

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
Feb 3, 2025

Conversation

bastimeyer
Copy link
Member

Fixes #6419

@ltguillaume please check and see if any content on the site is still not working correctly with these plugin fixes. The live streams are geo-blocked for me, and the main live stream apparently is currently offline. That shouldn't be a problem though, considering that the plugin only required simple validation schema changes, and no other stream-related changes.
https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#pull-request-feedback

$ ./script/test-plugin-urls.py nos -m
:: https://nos.nl/collectie/13951/video/2491092-dit-was-prinsjesdag
::  360p, 480p, 720p, 1080p, worst, best
::   {'id': '2491092', 'author': None, 'category': None, 'title': 'Dit was Prinsjesdag'}
:: https://nos.nl/l/2490788
::  360p, 480p, 720p, 1080p, worst, best
::   {'id': '2490788', 'author': None, 'category': None, 'title': 'Meteoor gespot boven noord Nederland'}
:: https://nos.nl/live
!! No streams found
:: https://nos.nl/livestream/2539164-schaatsen-wb-milwaukee-straks-de-massastart-m
:::: Content is inaccessible or may have expired
!! No streams found
:: https://nos.nl/video/2490788-meteoor-gespot-boven-noord-nederland
::  360p, 480p, 720p, 1080p, worst, best
::   {'id': '2490788', 'author': None, 'category': None, 'title': 'Meteoor gespot boven noord Nederland'}

@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Feb 2, 2025
@bastimeyer bastimeyer force-pushed the plugins/nos/fix-6419 branch from 07afca4 to c576a6a Compare February 3, 2025 14:04
@bastimeyer bastimeyer merged commit 9a4e937 into streamlink:master Feb 3, 2025
23 checks passed
@bastimeyer bastimeyer deleted the plugins/nos/fix-6419 branch February 3, 2025 14:09
@ltguillaume
Copy link

I tried this manually, none of the videos worked (the livestream is not available right now):

[session][info] Plugin nos is being overridden by C:\Users\Guillaume\AppData\Roaming\streamlink\plugins\nos.py (sha256:d2a0e0c41980655d1be1416e7cc4508b2b4f28354d1b9074341a6afe0332b2cc)
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.12.8
[cli][debug] OpenSSL:    OpenSSL 3.0.15 3 Sep 2024
[cli][debug] Streamlink: 7.1.2
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.12.14
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 5.3.0
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.21.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.28.0
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  urllib3: 2.3.0
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=https://nos.nl/l/2490404
[cli][debug]  --loglevel=debug
[cli][debug]  --default-stream=['best']
[cli][info] Found matching plugin nos for URL https://nos.nl/l/2490404
error: Unable to validate response text: ValidationError(NoneOrAllSchema):
  ValidationError(dict):
    Unable to validate value of key '@type'
    Context(AnySchema):
      ValidationError(equality):
        ['VideoObject', 'WebPage'] does not equal 'VideoObject'
      ValidationError(type):
        Type of ['VideoObject', 'WebPage'] should be str, but is list
[session][info] Plugin nos is being overridden by C:\Users\Guillaume\AppData\Roaming\streamlink\plugins\nos.py (sha256:d2a0e0c41980655d1be1416e7cc4508b2b4f28354d1b9074341a6afe0332b2cc)
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.12.8
[cli][debug] OpenSSL:    OpenSSL 3.0.15 3 Sep 2024
[cli][debug] Streamlink: 7.1.2
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.12.14
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 5.3.0
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.21.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.28.0
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  urllib3: 2.3.0
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=https://nos.nl/collectie/13951/video/2491092-dit-was-prinsjesdag
[cli][debug]  --loglevel=debug
[cli][debug]  --default-stream=['best']
[cli][info] Found matching plugin nos for URL https://nos.nl/collectie/13951/video/2491092-dit-was-prinsjesdag
error: Unable to validate response text: ValidationError(NoneOrAllSchema):
  ValidationError(dict):
    Unable to validate value of key '@type'
    Context(AnySchema):
      ValidationError(equality):
        ['VideoObject', 'WebPage'] does not equal 'VideoObject'
      ValidationError(type):
        Type of ['VideoObject', 'WebPage'] should be str, but is list
[session][info] Plugin nos is being overridden by C:\Users\Guillaume\AppData\Roaming\streamlink\plugins\nos.py (sha256:d2a0e0c41980655d1be1416e7cc4508b2b4f28354d1b9074341a6afe0332b2cc)
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.12.8
[cli][debug] OpenSSL:    OpenSSL 3.0.15 3 Sep 2024
[cli][debug] Streamlink: 7.1.2
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.12.14
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 5.3.0
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.21.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.28.0
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  urllib3: 2.3.0
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=https://nos.nl/l/2490788
[cli][debug]  --loglevel=debug
[cli][debug]  --default-stream=['best']
[cli][info] Found matching plugin nos for URL https://nos.nl/l/2490788
error: Unable to validate response text: ValidationError(NoneOrAllSchema):
  ValidationError(dict):
    Unable to validate value of key '@type'
    Context(AnySchema):
      ValidationError(equality):
        ['VideoObject', 'WebPage'] does not equal 'VideoObject'
      ValidationError(type):
        Type of ['VideoObject', 'WebPage'] should be str, but is list
[session][info] Plugin nos is being overridden by C:\Users\Guillaume\AppData\Roaming\streamlink\plugins\nos.py (sha256:d2a0e0c41980655d1be1416e7cc4508b2b4f28354d1b9074341a6afe0332b2cc)
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.12.8
[cli][debug] OpenSSL:    OpenSSL 3.0.15 3 Sep 2024
[cli][debug] Streamlink: 7.1.2
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.12.14
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 5.3.0
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.21.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.28.0
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  urllib3: 2.3.0
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=https://nos.nl/video/2490788-meteoor-gespot-boven-noord-nederland
[cli][debug]  --loglevel=debug
[cli][debug]  --default-stream=['best']
[cli][info] Found matching plugin nos for URL https://nos.nl/video/2490788-meteoor-gespot-boven-noord-nederland
error: Unable to validate response text: ValidationError(NoneOrAllSchema):
  ValidationError(dict):
    Unable to validate value of key '@type'
    Context(AnySchema):
      ValidationError(equality):
        ['VideoObject', 'WebPage'] does not equal 'VideoObject'
      ValidationError(type):
        Type of ['VideoObject', 'WebPage'] should be str, but is list

@bastimeyer
Copy link
Member Author

I tried this manually, none of the videos worked

You can't sideload the PR changes, as they depend on further changes on the master branch.

Build from the master branch, or wait for the next nightly builds to be built.

$ streamlink -l debug -o /dev/null https://nos.nl/l/2490404 best
[cli][debug] OS:         Linux-6.13.1-1-git-x86_64-with-glibc2.41
[cli][debug] Python:     3.13.1
[cli][debug] OpenSSL:    OpenSSL 3.4.0 22 Oct 2024
[cli][debug] Streamlink: 7.1.2+17.g9a4e937d
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.12.14
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 5.3.0
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.21.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.27.0
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  urllib3: 2.3.0
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=https://nos.nl/l/2490404
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=/usr/bin/mpv
[cli][debug]  --output=/dev/null
[cli][debug]  --webbrowser-headless=True
[cli][info] Found matching plugin nos for URL https://nos.nl/l/2490404
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 360p (worst), 480p, 720p, 1080p (best)
[cli][info] Opening stream: 1080p (hls)
[cli][info] Writing output to
/dev/null
[cli][debug] Checking file output
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] First Sequence: 1; Last Sequence: 2
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 1; End Sequence: 2
[stream.hls][debug] Adding segment 1 to queue
[stream.hls][debug] Adding segment 2 to queue
[stream.segmented][debug] Closing worker thread
[stream.hls][debug] Writing segment 1 to output
[stream.hls][debug] Segment 1 complete
[cli][debug] Writing stream to output
[stream.hls][debug] Writing segment 2 to output
[stream.hls][debug] Segment 2 complete
[stream.segmented][debug] Closing writer thread
[download] Written 5.39 MiB to /dev/null (0s)                                                                                                   
[cli][info] Stream ended
[cli][info] Closing currently open stream...

@ltguillaume
Copy link

Just tested the nightly build. Can confirm all the links now work, thanks!!

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plugins.nos: No plugin can handle URL | Unable to validate response text
2 participants