Closed nrk666 closed 1 year ago
It seems like you're familiar with coding. If that's the case, create a pull request in order to fix it.
Not so much with the Python. Kodi starts adding Perl or bash addons, then I can hang.
I think I figured out what's wrong and no python experience needed.
The URL that stripchat.py pulls for the model list is getting the list, but even if the stream is listed for 1920x1080, its only giving out 480p resolution m3u8's.
Example (I dunno what model this is, I just picked one) :
"stream": { "width": 1920, "height": 1080, "url": "https://b-hls-10.doppiocdn.com/hls/75357246_480p/master/75357246_480p.m3u8", "urls": { "480p": "https://b-hls-10.doppiocdn.com/hls/75357246_480p/master/75357246_480p.m3u8", "original": "https://b-hls-10.doppiocdn.com/hls/75357246_480p/master/75357246_480p.m3u8", "240p": "https://b-hls-10.doppiocdn.com/hls/75357246_240p/master/75357246_240p.m3u8", "160p": "https://b-hls-10.doppiocdn.com/hls/75357246_160p/master/75357246_160p.m3u8" } },
On the website, that model is broadcasting in HD.
There will be a fix in the next release 1.1.55 https://github.com/dobbelina/repository.dobbelina/commit/0778b2b27e6d82dbe1c2b8dedd21e18aa7488e17
Awesome, thank you!
The HD Stream m3u8 part is fixed (thank you), but the non-HD models are still showing up in the HD Model list. I tried to take a look at it but I can't figure out where the "isHD" or "isn'tHD" choice is made for the HD menu item, but there is a "broadcastHD" flag in the json that could be checked. The best I could think of was for the HD menu item, instead of putting models into "List" make a new "HDList" or something and have it drop anyone who isn't "broadcastHD: yes". That way "List" stays good for non-HD menu items and "HDList" drops out the low res models. I thought maybe List2 or List3 were for HD as they aren't referenced anywhere else but they have different content than "List" so now I just figured they were leftover from other sites as this file was likely just copied.
If you can tell me where the "this model is HD" or "this model isn't HD" is I can try to take a stab at it.
I dunno you probably have a better way, I'm just trying to figure out the python. It was all perl when I had to do this kinda stuff before (yeah, I'm old) and this is pretty different. What is "{0}"? Is that some kind of shorthand like perl "$_"? Seems like it should be some sort of list object maybe? The ".format(bu)" part makes me think that anyway cuz "bu" is clearly the retrieved json. Thanks for your fixes so far, appreciate it.
I figured it out.
stripchat.py line 35:
FROM: site.add_dir('[COLOR hotpink]HD[/COLOR]', '{0}hd'.format(bu), 'List', '', '') TO: site.add_dir('[COLOR hotpink]HD[/COLOR]', '{0}hd'.format(bu) + "&broadcastHD=true", 'List', '', '')
That will stop the low res models from showing under "HD". NOTE: needs the previous URL fix attached to this issue for this to work correctly.
patch:
that {0}hd.format(bu) was fucking me up cuz I didn't know what it was, so I put a print statement in and watched the debug log, saw it was just a formatted url (I thought it was parsing the json somehow) so I could probably append text to it and it worked.
What's up @nrk666 As yourself, I'm trying to learn Python as well. I was going to chime in a couple of days ago but got busy.
Not to sure if it will completely clear out the non-HD streams though. Take a look at this pic. Even though "broadcastHD: is True" & the "stream" info is showing as "Width:1280" & "Height:720", which is the minimum for HD. Look at the URLS that is provided, the highest it's showing is 480p. It's not an HD stream. I think it will be a hit or miss on HD links. Hopefully a Dev could chime in on this... Good job on looking into it though...
Nah, its good. The broadcastHD flag has been accurate on a bunch that I have checked. The SD m3u8's is what got fixed in the first update, so even though we are only getting handed 480p m3u8's, the url fix that is coming on next update grabs the max hd m3u8. Before the url fix, everything was 480p period, and with the url fix, I'm getting 1080p/720p again. I'm pretty sure these fixes are good. I've tested this out on my local linux+Kodi with all the new changes applied and it seems to be working. I haven't seen a single SD cam in HD, and if you go to the other categories, they are there.
I just updated my comment that you need the previous url fix for my patch to work correctly.
thanks, the fix will be added in the next release
As you figured out, {0}hd.format(bu)
is the same thing asbu + 'hd'
, {0} is the first parameter from format (in this case the bu variable)
'{0}hd'.format(bu) + "&broadcastHD=true"
works but it's more readable written '{0}hd&broadcastHD=true'.format(bu)
Ah, so its like a back reference. Yeah man, format it any way you see fit. OH, the "hd" is appended to the final param inside the bu string, &tag=hd, and in the other categories it's "female" or "male" or "whatever", ok I see it now, thanks. That really helps.
I guess if we are fixing HD, lets fix it for everyone:
bu = "https://stripchat.com/api/external/v4/widget/?limit=1000&modelsCountry=&modelsLanguage=&modelsList=&tag="
if female:
site.add_dir('[COLOR hotpink]Female HD[/COLOR]', '{0}female&broadcastHD=true'.format(bu), 'List', '', '')
site.add_dir('[COLOR hotpink]Female[/COLOR]', '{0}female'.format(bu), 'List', '', '')
if couple:
site.add_dir('[COLOR hotpink]Couples HD[/COLOR]', '{0}couples&broadcastHD=true'.format(bu), 'List', '', '')
site.add_dir('[COLOR hotpink]Couples[/COLOR]', '{0}couples'.format(bu), 'List', '', '')
if male:
site.add_dir('[COLOR hotpink]Male HD[/COLOR]', '{0}men&broadcastHD=true'.format(bu), 'List', '', '')
site.add_dir('[COLOR hotpink]Male[/COLOR]', '{0}men'.format(bu), 'List', '', '')
if trans:
site.add_dir('[COLOR hotpink]Transsexual HD[/COLOR]', '{0}trans&broadcastHD=true'.format(bu), 'List', '', '')
site.add_dir('[COLOR hotpink]Transsexual[/COLOR]', '{0}trans'.format(bu), 'List', '', '')
utils.eod()
Apologize for not submitting a pull req, tbh, I have no idea how to.
Thanks @nrk666 for the fix. It is incorporated: https://github.com/dobbelina/repository.dobbelina/commit/05f51ed1f8594c74cec19ed753ed48e486435fe1
Bug reports:
Site: Stripchat
Model Category "HD" shows many non-HD streams, example: ###x480. The broadcast hd flag is "false" in the model json list that gets fetched so maybe they just changed the key in the json. There is no error in addon, its just showing broadcast hd flag = false content in the HD section where should only be broadcast hd = true.
OS environment
Nvidia Shield Kodi 19.4 Cumination 1.1.54 Windows 10 Kodi 19.4 Cumination 1.1.54 Linux (debian) Kodi 19.4 Cumination 1.1.54
https://paste.kodi.tv/fixiyocobo - there is no error, just showing wrong content