-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
plugins.lnk: add new plugin #4364
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
Conversation
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.
Thanks for the PR. Adding a plugin for this site should be fine since this includes a live news channel.
Are the channel IDs static? According to the https://lnk.lt/api/main/content-page-by-program/tiesiogiai
API endpoint, the IDs are episodeId
s with certain endDate
s, so this suggests that they are dynamic.
The plugin code also needs some rework. I have fixed and improved it locally, so if you don't mind, I can add a commit to your PR branch.
It looks like some of the content is geo-restricted. Ideally, you should note that in the plugin matrix. You could probably test for it, provide an info level message then just return.
You could also look at using schema validation for the returned JSON. Also, as it's available, you could consider adding |
Yes, I have done all of that already, but before pushing onto someone else's branch, I usually ask first. |
Thank you both for the quick review.
The "airDate": "2020-12-28T12:58:16.674",
"airDateText": "2020-12-28 12:58", which makes me believe that the IDs do not change very often 🙂 It might be more correct to request
Absolutely, please go ahead! I am very new to the codebase, so I can't exactly say I know better. @mkbloke Thank you for your notes, will try to look into the issues you mentioned as well. |
@bastimeyer, OK. I was only making suggestions for the OP. That wasn't intended for you, it just happened to come after your reply. |
Let's wait and check if the IDs change. If they change, then this static channel map obviously can't stay. |
E.g.: `https://lnk.lt/tiesiogiai` would previously raise "[plugins.lnk][error] Unknown channel: None". This is because, per Python's docs, matchdict: > Return a dictionary containing all the named subgroups of the match, > keyed by the subgroup name. The default argument is used for groups > that did not participate in the match; it defaults to None. Therefore, get("channel", "lnk") would return the value of `None`, as the key exists, rather than falling back to `"lnk"`.
Hi again, reporting a couple days later, the IDs have not changed. $ date -u
Sun Feb 27 08:04:35 PM UTC 2022
$ curl -sS https://lnk.lt/api/main/content-page-by-program/tiesiogiai | jq -r '.components[1].component.channels[] | [.channel, .episodeId] | @csv'
"LNK",137535
"BTV",137534
"2TV",95343
"Info TV",137748
"TV1",106791 |
Co-Authored-By: bastimeyer <mail@bastimeyer.de>
Co-authored-by: bastimeyer <mail@bastimeyer.de>
LNK is a Lithuanian broadcasting group with several TV channels under it. Those are freely streamed at https://lnk.lt/tiesiogiai .