Skip to content

Commit

Permalink
Merge pull request anxdpanic#506 from MoojMidge/master
Browse files Browse the repository at this point in the history
Client and stream processing updates
  • Loading branch information
MoojMidge authored and JimmyS83 committed Oct 11, 2023
1 parent 3891a17 commit 64901c9
Show file tree
Hide file tree
Showing 4 changed files with 300 additions and 401 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/submit-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,31 @@ jobs:
GH_USERNAME: anxdpanic
GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }}
EMAIL: [email protected]

- name: Staging for Official Repository (Matrix)
id: stage-matrix
run: |
git reset --hard ${{ github.sha }}
git checkout .
git clean -fdx
mv .git ..
rm -rf .??*
mv ../.git .
rm *.md
version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml)
xmlstarlet ed -L -u '/addon/@version' -v "${version}+matrix.1" addon.xml
xmlstarlet ed -L -u '/addon/requires/import[@addon="xbmc.python"]/@version' -v '3.0.0' addon.xml
xmlstarlet ed -L -d '/addon/requires/import[@addon="script.module.infotagger"]' addon.xml
git add .
git commit -m "Kodi 19 Patch"
working-directory: ${{ github.event.repository.name }}

- name: Submit to Official Repository (Matrix)
id: submit-matrix
run: |
submit-addon -r repo-plugins -b matrix --pull-request ${{ github.event.repository.name }}
working-directory: ${{ github.event.repository.name }}
env:
GH_USERNAME: anxdpanic
GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }}
EMAIL: [email protected]
33 changes: 16 additions & 17 deletions resources/lib/youtube_plugin/kodion/impl/abstract_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,23 +224,22 @@ def use_remote_history(self):
return self.get_bool(SETTINGS.USE_REMOTE_HISTORY, False)

# Selections based on max width and min height at common (utra-)wide aspect ratios
# 8K and 4K at 32:9, 2K at 8:3, remainder at 22:9 (2.444...)
# MPD_QUALITY_SELECTION value
_QUALITY_SELECTIONS = ['mp4', # 8 (default)
'webm', # 9
{'width': 256, 'height': 105, 'label': '144p{0}{1}'}, # No setting
{'width': 426, 'height': 175, 'label': '240p{0}{1}'}, # 0
{'width': 640, 'height': 263, 'label': '360p{0}{1}'}, # 1
{'width': 854, 'height': 350, 'label': '480p{0}{1}'}, # 2
{'width': 1280, 'height': 525, 'label': '720p{0} (HD){1}'}, # 3
{'width': 1920, 'height': 787, 'label': '1080p{0} (FHD){1}'}, # 4
{'width': 2560, 'height': 984, 'label': '1440p{0} (2K){1}'}, # 5
{'width': 3840, 'height': 1080, 'label': '2160p{0} (4K){1}'}, # 6
{'width': 7680, 'height': 3148, 'label': '4320p{0} (8K){1}'}, # 7
{'width': 0, 'height': 0, 'label': '{2}p{0}{1}'}] # Unknown quality

def get_mpd_video_qualities(self, list_all=False):
if not self.use_dash_videos():
_QUALITY_SELECTIONS = { # Setting | Resolution
7: {'width': 7680, 'height': 3148, 'label': '4320p{0} (8K){1}'}, # 7 | 4320p 8K
6: {'width': 3840, 'height': 1080, 'label': '2160p{0} (4K){1}'}, # 6 | 2160p 4K
5: {'width': 2560, 'height': 984, 'label': '1440p{0} (QHD){1}'}, # 5 | 1440p 2.5K / QHD
4.1: {'width': 2048, 'height': 858, 'label': '1152p{0} (2K){1}'}, # N/A | 1152p 2K / QWXGA
4: {'width': 1920, 'height': 787, 'label': '1080p{0} (FHD){1}'}, # 4 | 1080p FHD
3: {'width': 1280, 'height': 525, 'label': '720p{0} (HD){1}'}, # 3 | 720p HD
2: {'width': 854, 'height': 350, 'label': '480p{0}{1}'}, # 2 | 480p
1: {'width': 640, 'height': 263, 'label': '360p{0}{1}'}, # 1 | 360p
0: {'width': 426, 'height': 175, 'label': '240p{0}{1}'}, # 0 | 240p
-1: {'width': 256, 'height': 105, 'label': '144p{0}{1}'}, # N/A | 144p
-2: {'width': 0, 'height': 0, 'label': '{2}p{0}{1}'}, # N/A | Custom
}

def get_mpd_video_qualities(self):
if not self.use_mpd_videos():
return []
selected = self.get_int(SETTINGS.MPD_QUALITY_SELECTION, 4)
return [quality for key, quality in self._QUALITY_SELECTIONS.items()
Expand Down
32 changes: 6 additions & 26 deletions resources/lib/youtube_plugin/kodion/impl/xbmc/xbmc_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,33 +328,13 @@ def inputstream_adaptive_capabilities(self, capability=None):
if not self.use_inputstream_adaptive() or not inputstream_version:
return frozenset() if capability is None else None

# Values of capability map can be any of the following:
# - required version number as string for comparison with actual installed InputStream.Adaptive version
# - any Falsey value to exclude capability regardless of version
# - True to include capability regardless of version
capability_map = {
'live': '2.0.12',
'drm': '2.2.12',
# audio
'vorbis': '2.3.14',
'opus': '19.0.7',
'mp4a': True,
'ac-3': '2.1.15',
'ec-3': '2.1.15',
'dts': '2.1.15',
# video
'avc1': True,
'av01': '20.3.0',
'vp8': False,
'vp9': '2.3.14',
'vp9.2': '2.3.14',
}

ia_loose_version = utils.loose_version(inputstream_version)
if capability is None:
ia_loose_version = utils.loose_version(inputstream_version)
capabilities = frozenset(key for key, version in capability_map.items()
if version is True
or version and ia_loose_version >= utils.loose_version(version))
capabilities = frozenset(
capability for capability, version in self._IA_CAPABILITIES.items()
if version is True
or version and ia_loose_version >= utils.loose_version(version)
)
return capabilities
version = self._IA_CAPABILITIES.get(capability)
return version is True or version and ia_loose_version >= utils.loose_version(version)
Expand Down
Loading

0 comments on commit 64901c9

Please sign in to comment.