Skip to content

Commit

Permalink
slyguy.hbo.max > v0.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
matthuisman authored and johnny5-is-alive committed Sep 23, 2021
1 parent e5d1ed5 commit d7e09dd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions slyguy.hbo.max/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="slyguy.hbo.max" name="HBO Max" provider-name="Slyguy" version="0.5.6">
<addon id="slyguy.hbo.max" name="HBO Max" provider-name="Slyguy" version="0.5.7">
<requires>
<import addon="script.module.slyguy"/>
</requires>
Expand All @@ -14,7 +14,7 @@ Subscription required.</description>
<license></license>
<language></language>
<website></website>
<news>Add playback language selection and default setting</news>
<news>Fix subtitles</news>
<assets>
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
Expand Down
2 changes: 1 addition & 1 deletion slyguy.hbo.max/resources/lib/constants.py
@@ -1,6 +1,6 @@
DEVICE_MODEL = 'androidtv'

VERSION = '100.35.0.280'
VERSION = '50.49.0.0'

HEADERS = {
'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; SHIELD Android TV Build/LMY47D)',
Expand Down
15 changes: 13 additions & 2 deletions slyguy.hbo.max/resources/lib/plugin.py
Expand Up @@ -531,6 +531,11 @@ def play(slug, **kwargs):
'Authorization': 'Bearer {}'.format(userdata.get('access_token')),
}

# if '_noanc_ad_' not in data['url']:
# new_url = data['url'].replace('_ad_', '_noanc_ad_')
# log.debug('Manifest url changed from {} to {} (to disable embedded ads)'.format(data['url'], new_url))
# data['url'] = new_url

item = plugin.Item(
path = data['url'],
inputstream = inputstream.MPD(),
Expand Down Expand Up @@ -591,9 +596,15 @@ def play(slug, **kwargs):
item.play_next['next_file'] = 'urn:hbo:feature:' + slug.split(':')[3]
break

# base_url = data['url'].rsplit('/', 1)[0]
for row in data.get('textTracks', []):
if 'url' in row:
item.subtitles.append({'url':row['url'], 'language':row['language'], 'forced': row['type'].lower() == 'forced'})
if 'url' not in row:
continue
# row['url'] = '{base_url}/t/sub/{language}_{type}.xml'.format(base_url=base_url, language=row['language'], type='forced' if row['type'].lower() == 'forced' else 'sub')
# log.debug('Generated subtitle url: {}'.format(row['url']))
# sometimes they end with sub and other times sdh

item.subtitles.append({'url':row['url'], 'language':row['language'], 'forced': row['type'].lower() == 'forced'})

if settings.getBool('sync_playback', False):
item.callback = {
Expand Down

0 comments on commit d7e09dd

Please sign in to comment.