-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Update kommunetv.py #32931
base: master
Are you sure you want to change the base?
Update kommunetv.py #32931
Conversation
Look at https://www.aventia.no/kommunetv/vare-kunder/ They are also in Sweeden. Here is a problem tho. https://stavanger.kommunetv.no/live/841 https://stavanger.kommunetv.no/archive/841 what if there is a live and a archive at the same time? how dose that work?
If those are not the same thing (eg |
@@ -6,7 +6,8 @@ | |||
|
|||
|
|||
class KommunetvIE(InfoExtractor): | |||
_VALID_URL = r'https://(\w+).kommunetv.no/archive/(?P<id>\w+)' | |||
_VALID_URL = r'https?://\w+\.kommun(?:etv\.no|\.tv)/(?:archive|live)/(?P<id>\w+)' | |||
|
|||
_TEST = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this
_TESTS = [{
...
}]
and add tests for the various URL types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have considered doing something like that, but I'm unsure how to obtain the MD5 values.
Alternatively, I could create a new function specifically for live streams.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MD5 values may not be critical, especially as the site is sending adaptive formats where the value could vary. Anyhow, just draft a test case with url
, id
, ext
; the test harness will tell you what other values must be included. For optional items like md5
, include a dummy value and the test harness will show the correct value.
Yes they are different content. The central difference is that the 'live' ID is for ween they are live and then after they are live the get converted into a archive but with a different ID. But ween a there exist a archive and ween they are livestraming tehy are not downloading the live but instead youtube-dl downloads the archive woon. For instance https://stavanger.kommunetv.no/live/841 gets converted into a new ID and that is https://stavanger.kommunetv.no/archive/1142 |
live/841 corresponds to streamType=2&id=841 in the API; Maybe the If the live id gives 404 (no longer live), the page tries |
@@ -6,7 +6,8 @@ | |||
|
|||
|
|||
class KommunetvIE(InfoExtractor): | |||
_VALID_URL = r'https://(\w+).kommunetv.no/archive/(?P<id>\w+)' | |||
_VALID_URL = r'https?://\w+\.kommun(?:etv\.no|\.tv)/(?:archive|live)/(?P<id>\w+)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_VALID_URL = r'https?://\w+\.kommun(?:etv\.no|\.tv)/(?:archive|live)/(?P<id>\w+)' | |
_VALID_URL = r'(?P<where>https?://\w+\.kommun(?:etv\.no|\.tv))/(?P<what>archive|live)/(?P<id>\w+)' |
Then use the where
group in the API URL (maybe Stavanger.kommunetv.no/api has diferent data from Oslo.kommunetv.no/api ?). Use the what
to generate the correct streamType
for the API, using ._download_json_handle(..., expected_status=404)
for the live case and then chasing down the archive content if the live is gone.
Look at https://www.aventia.no/kommunetv/vare-kunder/
They are also in Sweeden.
Here is a problem tho.
https://stavanger.kommunetv.no/live/841
https://stavanger.kommunetv.no/archive/841
what if there is a live and a archive at the same time? how dose that work?
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
Explanation of your pull request in arbitrary form goes here. Please make sure the description explains the purpose and effect of your pull request and is worded well enough to be understood. Provide as much context and examples as possible.