Skip to content

Commit

Permalink
Merge pull request #4408 from dimkroon/matrix
Browse files Browse the repository at this point in the history
[plugin.video.viwx] 1.1.1
  • Loading branch information
basrieter authored Oct 31, 2023
2 parents 14838a5 + dbb49a5 commit 27fec51
Show file tree
Hide file tree
Showing 9 changed files with 234 additions and 113 deletions.
12 changes: 10 additions & 2 deletions plugin.video.viwx/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.viwx" name="viwX" version="1.0.0" provider-name="Dimitri Kroon">
<addon id="plugin.video.viwx" name="viwX" version="1.1.1" provider-name="Dimitri Kroon">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="inputstream.adaptive" version="19.0.5"/>
Expand Down Expand Up @@ -30,7 +30,15 @@
<fanart>resources/fanart.png</fanart>
</assets>
<news>
First stable release
[B]v1.1.1[/B]
- fix: playing VOD on kodi Omega failed with error.

[B]v1.1.0[/B]
- Updated user-agent string to Firefox 118.
- Added support for Live TV items in collections. Fixes: collection 'ITVX Live Channels' is empty.
- Added support for shortFromSlider in collection, like the folder with short news-like items in the collection 'Rugby World Cup'.
- Added support for shorForm collections. Fixes: absence of the collection 'Rugby World Cup 2023'.
- Adapt to a change at itvx causing an empty 'Kids Collection'.
</news>
<reuselanguageinvoker>true</reuselanguageinvoker>
</extension>
Expand Down
10 changes: 10 additions & 0 deletions plugin.video.viwx/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
v 1.1.1
- fix: playing VOD on kodi Omega failed with error.

v 1.1.0
- Updated user-agent string to Firefox 118.
- Added support for Live TV items in collections. Fixes: collection 'ITVX Live Channels' is empty.
- Added support for shortFromSlider in collection, like the folder with short news-like items in the collection 'Rugby World Cup'.
- Added support for shorForm collections. Fixes: absence of the collection 'Rugby World Cup 2023'.
- Adapt to a change at itvx causing an empty 'Kids Collection'.

v 1.0.0
- First release.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ msgid "Resume from"
msgstr ""

msgctxt "#30620"
msgid "Play from the start"
msgid "Watch from the start"
msgstr ""

msgctxt "#30621"
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.viwx/resources/lib/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


WEB_TIMEOUT = (3.5, 7)
USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0'
USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0'


logger = logging.getLogger('.'.join((logger_id, __name__.split('.', 2)[-1])))
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.viwx/resources/lib/itv_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def login(self, uname: str, passw: str):
'https://auth.prd.user.itv.com/auth',
req_data,
headers={'Accept': 'application/vnd.user.auth.v2+json',
'Akamai-BM-Telemetry': '7a74G7m23Vrp0o5c9379441.75-1,2,-94,-100,Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0,uaend,11059,20100101,nl,Gecko,5,0,0,0,409881,2462846,1680,1010,1680,1050,1680,925,1680,,cpen:0,i1:0,dm:0,cwen:0,non:1,opc:0,fc:1,sc:0,wrc:1,isc:85,vib:1,bat:0,x11:0,x12:1,5663,0.09571883547,832931231423,0,loc:-1,2,-94,-131,-1,2,-94,-101,do_en,dm_en,t_dis-1,2,-94,-105,0,-1,0,0,2422,113,0;0,-1,0,0,1102,520,0;1,0,0,0,1465,883,0;-1,2,-94,-102,0,0,0,0,2422,113,0;0,-1,1,0,1102,520,0;1,0,1,0,1465,883,0;-1,2,-94,-108,0,1,11374,16,0,0,883;1,1,11749,-2,0,8,883;2,3,11749,-2,0,8,883;3,2,11909,-2,0,8,883;4,2,11941,16,0,8,883;5,1,12086,-2,0,0,883;6,3,12086,-2,0,0,883;7,2,12213,-2,0,0,883;8,1,12422,-2,0,0,883;9,3,12422,-2,0,0,883;10,2,12541,-2,0,0,883;11,1,12766,-2,0,0,883;12,3,12766,-2,0,0,883;-1,2,-94,-110,0,1,1363,1044,37;1,1,1379,1029,47;2,1,1396,998,59;3,1,1413,888,96;4,1,1429,792,122;5,1,1446,698,146;6,1,1462,590,170;7,1,1478,520,186;8,1,1496,478,196;9,1,1512,442,204;10,1,1530,418,210;11,1,1546,406,216;12,1,1562,400,217;13,1,1621,400,219;14,1,1630,400,221;15,1,1742,402,221;16,1,1750,403,222;17,1,1763,405,223;18,1,1780,410,223;19,1,1795,415,224;20,1,1812,425,225;21,1,1829,431,225;22,1,1847,442,225;23,1,1863,455,222;24,1,1880,470,216;25,1,1896,487,211;26,1,1929,506,206;27,1,1930,523,199;28,1,1946,530,195;29,1,1997,531,194;30,1,2026,531,193;31,1,2029,530,191;32,1,2046,529,189;33,1,2063,527,188;34,1,2080,523,184;35,1,2095,519,182;36,1,2113,517,180;37,1,2130,516,180;38,3,2334,516,180,520;39,4,2480,516,180,520;40,2,2480,516,180,520;41,1,3070,518,178;42,1,3078,522,178;43,1,3086,525,178;44,1,3094,527,178;45,1,3099,531,178;46,1,3108,533,178;47,1,3116,535,178;48,1,3125,539,178;49,1,3133,543,178;50,1,3142,548,178;51,1,3149,554,178;52,1,3157,565,178;53,1,3165,576,179;54,1,3174,592,183;55,1,3181,617,189;56,1,3224,844,245;57,1,3240,964,271;58,1,3257,1092,297;59,1,3273,1194,305;60,1,3290,1278,309;61,1,3307,1350,307;62,1,3324,1418,297;63,1,3340,1464,289;64,1,3357,1506,285;65,1,3373,1544,281;66,1,3390,1590,275;67,1,3407,1626,269;68,1,3423,1648,261;69,1,3440,1652,251;70,1,3456,1654,247;71,1,3629,1653,247;72,1,3637,1649,248;73,1,3646,1649,250;74,1,3654,1649,251;75,1,3670,1651,252;76,1,3687,1657,239;77,1,3704,1664,225;78,1,3721,1672,213;79,1,3737,1677,205;80,1,7228,1617,184;81,1,7244,1537,200;82,1,7260,1405,218;83,1,7278,1159,238;84,1,7294,973,254;85,1,7311,775,262;86,1,7329,557,270;87,1,7345,357,274;88,1,7361,197,284;89,1,7378,83,268;90,1,7395,9,236;91,1,7411,-1,-1;92,1,7606,4,218;93,1,7615,9,219;94,1,7622,21,222;95,1,7630,39,222;96,1,7638,64,224;97,1,7646,94,224;98,1,7654,128,218;99,1,7663,160,216;100,1,7671,192,214;101,1,7678,218,214;102,1,7686,250,214;139,3,8277,480,178,520;140,4,8409,480,178,520;141,2,8409,480,178,520;176,3,10288,510,244,883;177,4,10391,510,244,883;178,2,10391,510,244,883;234,3,20817,406,425,1242;235,4,20936,406,425,1242;236,2,20942,406,425,1242;-1,2,-94,-117,-1,2,-94,-111,-1,2,-94,-109,-1,2,-94,-114,-1,2,-94,-103,3,51;2,6537;3,8264;-1,2,-94,-112,https://www.itv.com/hub/user/signin-1,2,-94,-115,169649,606167,32,0,0,0,775783,20959,0,1665862462846,6,17820,13,237,2970,8,0,20960,652788,1,1,49,951,-446417374,26067385,PiZtE,78068,22,0,-1-1,2,-94,-106,-1,0-1,2,-94,-119,-1-1,2,-94,-122,0,0,0,0,1,0,0-1,2,-94,-123,-1,2,-94,-124,-1,2,-94,-126,-1,2,-94,-127,-1,2,-94,-70,-844419666;149504396;dis;,7;true;true;true;-120;true;24;24;true;false;unspecified-1,2,-94,-80,6510-1,2,-94,-116,332483235-1,2,-94,-118,171916-1,2,-94,-129,,,44f5478a49e419c98b42237f92350e68f367f4784614425eab4847066ff6289d,,,,0-1,2,-94,-121,;8;1;0'
'Akamai-BM-Telemetry': 'a=&&&e=QzNGMDA0RjYzRDkxQ0IxOTgzOTg1NTYzNURDMkJEMjl+WUFBUU5NWWN1S2p0cHl1TEFRQUFJcUNhTkJXaWlSczVGWHRaWUtKRWdCd0VyWDI0L0ZiY051QkZwYUwyWTZldUxkWVQxYTNJSnRtQWxnQkh3UTA1MGt0cWVkR2t4YTVlbzZhZ2VhN1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sxZ118U15sVD9ITX5IcUh7USpJeS09dWB7JWoteV5ZQEoseUckM1QtKSo4ZUg9WD8gV11MMUU0bzMzLk5KO2IrNG0jZVBjd1pPZnxNfV1FM2RHdVhhfm5ffjQkZmpWTElIXnRBTyo8IXtNWi4oN059aEQpZXM9Mi5Fbl80PX05PnlrfXlgQ1lAOmQqaD0ueHdTRyBhc0lGQF4rI1llYiZ4KCEha1guVlpXOkQhaGU/TjMtX0l7SFBDd0M2LSwwQU1eZWZhTixTc0ZaUT8xK3B0Y3RJPF0xNTlvTD09VkIlU2EtSz4+cE1HVSp5TS9edC1vc1JGUGFeMmRNTTxfZyk0TF94bnhXLUBKMGFWRU09T0t1LmFyVGR1Wzw8O0soc2U='
}
)

Expand Down
63 changes: 42 additions & 21 deletions plugin.video.viwx/resources/lib/itvx.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,46 +161,67 @@ def main_page_items():


def collection_content(url=None, slider=None, hide_paid=False):
uk_tz = pytz.timezone('Europe/London')
time_fmt = ' '.join((xbmc.getRegion('dateshort'), xbmc.getRegion('time')))

if url:
# A collection that has its own dedicated page.
page_data = get_page_data(url, cache_time=43200)
if slider == 'shortFormSlider':
# return the items from the collection's shortFormSlider
for item in page_data['shortFormSlider']['items']:
yield parsex.parse_shortform_item(item, uk_tz, time_fmt)
return

collection = page_data['collection']
rails = page_data.get('rails')
editorial_sliders = page_data.get('editorialSliders')
shortform_slider = page_data.get('shortFormSlider')

if shortform_slider is not None:
yield parsex.parse_short_form_slider(shortform_slider, url)

if collection is not None:
col_items = collection.get('shows', [])
progr_gen = (parsex.parse_collection_item(item, hide_paid) for item in col_items)
elif rails:
# Do not sort this list on title
return list(filter(None, (parsex.parse_slider('', rail) for rail in rails)))
for item in collection.get('shows', []):
yield parsex.parse_collection_item(item, hide_paid)
elif editorial_sliders:
# Folders, or kind of sub-collections in a collection.
for slider in editorial_sliders:
yield parsex.parse_slider('', slider)
else:
logger.warning("Missing both collections and rails in data from '%s'.", url)
return []
logger.warning("Missing both collections and editorial_sliders in data from '%s'.", url)
return

else:
# A Collection that has all it's data on the main page and does not have its own page.
page_data = get_page_data('https://www.itv.com', cache_time=3600)

if slider == 'shortFormSliderContent':
uk_tz = pytz.timezone('Europe/London')
time_fmt = ' '.join((xbmc.getRegion('dateshort'), xbmc.getRegion('time')))
items_list = page_data['shortFormSliderContent'][0]['items']
progr_gen = (parsex.parse_news_collection_item(news_item, uk_tz, time_fmt, hide_paid)
for news_item in items_list)
# Currently only handling News short form. The only other known shorFromSlider is
# 'Sport' and is handled as a full collection.
items_list = None
for slider in page_data['shortFormSliderContent']:
if slider['key'] == 'newsShortForm':
for news_item in slider['items']:
yield parsex.parse_shortform_item(news_item, uk_tz, time_fmt, hide_paid)

if items_list is None:
logger.warning("News shortFormSlider unexpectedly absent from main page")
return

elif slider == 'trendingSliderContent':
items_list = page_data['trendingSliderContent']['items']
progr_gen = (parsex.parse_trending_collection_item(trending_item, hide_paid)
for trending_item in items_list)
for trending_item in items_list:
yield parsex.parse_trending_collection_item(trending_item, hide_paid)

else:
try:
items_list = page_data['editorialSliders'][slider]['collection']['shows']
except KeyError:
logger.error("Failed to parse collection content: Unknown slider '%s'", slider)
return []
progr_gen = (parsex.parse_collection_item(item, hide_paid) for item in items_list)
return
for item in items_list:
yield parsex.parse_collection_item(item, hide_paid)

progr_list = sorted(filter(None, progr_gen), key=lambda prog: prog['show']['info']['sorttitle'])
return progr_list


def episodes(url, use_cache=False):
Expand Down Expand Up @@ -379,11 +400,11 @@ def category_news_content(url, sub_cat, rail=None, hide_paid=False):
return []

if hide_paid:
return [parsex.parse_news_collection_item(news_item, uk_tz, time_fmt)
return [parsex.parse_shortform_item(news_item, uk_tz, time_fmt)
for news_item in items_list
if not news_item.get('isPaid')]
else:
return [parsex.parse_news_collection_item(news_item, uk_tz, time_fmt)
return [parsex.parse_shortform_item(news_item, uk_tz, time_fmt)
for news_item in items_list]


Expand Down
Loading

0 comments on commit 27fec51

Please sign in to comment.