Skip to content

Commit

Permalink
v0.4.13:
Browse files Browse the repository at this point in the history
- change VOD request to the one received from the server, this limits playback in most cases to SD resolution without Plus+.
  • Loading branch information
fayer3 committed Sep 23, 2020
1 parent 54217b5 commit 17df903
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
4 changes: 3 additions & 1 deletion 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.joyn_app" name="Joyn" version="0.4.12" provider-name="fayer3">
<addon id="plugin.video.joyn_app" name="Joyn" version="0.4.13" provider-name="fayer3">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.routing" version="0.2.0"/>
Expand Down Expand Up @@ -72,6 +72,8 @@
- verfügbar seit/bis zu Filmbeschreibungen hinzugefügt.
0.4.12:
- VOD Abfrage repariert dank hrickes.
0.4.13:
- ändernder VOD Abfrage zu der vom Server erhaltenen, dies limitiert tie Auflösung auf SD ohne Plus+.
</news>
<assets>
<icon>resources/icon.png</icon>
Expand Down
4 changes: 3 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,6 @@ v0.4.11:
- fix error that prevented retrieving of videos.
- added available since/until to movie description.
v0.4.12:
- fixed VOD request thanks to hrickes.
- fixed VOD request thanks to hrickes.
v0.4.13:
- change VOD request to the one received from the server, this limits playback in most cases to SD resolution without Plus+.
36 changes: 25 additions & 11 deletions resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
try:
from urllib.request import Request, urlopen, build_opener, ProxyHandler
from urllib.error import HTTPError, URLError
from urllib.parse import quote, unquote
from urllib.parse import quote, unquote, urlparse, parse_qs
except ImportError:
from urlparse import urlparse, parse_qs
from urllib import quote, unquote
from urllib2 import Request, urlopen, HTTPError, URLError, build_opener, ProxyHandler

Expand Down Expand Up @@ -985,17 +986,30 @@ def play_video(video_id, tvshow_id, brand, duration):
#got add, extract mpd
log(u'stream with add: {0}'.format(video_data['videoUrl']))
video_url = video_data['videoUrl']
video_url_data = get_url(video_url, headers={'User-Agent': ids.video_useragent}, key = False, critical = True)
# get base url
base_urls = re.findall('<BaseURL>(.*?)</BaseURL>',video_url_data)
if len(base_urls) > 0 and base_urls[0].startswith('http'):
video_url = base_urls[0] + u'.mpd?filter=(type%3D%3D%22video%22)%7C%7C(true)|User-Agent='+ids.video_useragent
else:
kodiutils.notification(u'INFO', kodiutils.get_string(32005))
setResolvedUrl(plugin.handle, False, playitem)
return

found = False
#parse url an look if viedo url with filter is included
parsed_url = urlparse(video_url)
if parsed_url[4]:
parsed_query = parse_qs(parsed_url[4])
if 'yo.p.fn' in parsed_query and len(parsed_query['yo.p.fn']) > 0:
found = True
#add missing padding
base64_url_with_padding = parsed_query['yo.p.fn'][0] + '==='
log(u'base64 url: {0}'.format(base64_url_with_padding))
video_url = base64.b64decode(base64_url_with_padding)
if not found:
video_url_data = get_url(video_url, headers={'User-Agent': ids.video_useragent}, key = False, critical = True)
# get base url
base_urls = re.findall('<BaseURL>(.*?)</BaseURL>',video_url_data)
if len(base_urls) > 0 and base_urls[0].startswith('http'):
video_url = base_urls[0] + u'.mpd?filter=(type%3D%3D%22video%22)%7C%7C(true)|User-Agent='+ids.video_useragent
else:
kodiutils.notification(u'INFO', kodiutils.get_string(32005))
setResolvedUrl(plugin.handle, False, playitem)
return
else:
video_url = video_data['videoUrl'].rpartition('?')[0] + u'|User-Agent='+ids.video_useragent
video_url = video_data['videoUrl']+ u'|User-Agent='+ids.video_useragent#.rpartition('?')[0] + u'|User-Agent='+ids.video_useragent

is_helper = None
if video_data['drm'] != u'widevine':
Expand Down

0 comments on commit 17df903

Please sign in to comment.