Skip to content

Commit

Permalink
improved resolver for jawcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
kokangit committed Jan 5, 2018
1 parent 251c9b7 commit b00798e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<addon id="plugin.video.dreamfilm" name="Dreamfilm" provider-name="Daniel Lundin" version="0.1.15.10">
<addon id="plugin.video.dreamfilm" name="Dreamfilm" provider-name="Daniel Lundin" version="0.1.15.11">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,7 @@ Changed referer domain to "io", fixed error #48
version 0.1.15.10
=================
Fixed issue #53: added resolver for jawcloud

version 0.1.15.11
=================
improved resolver for jawcloud
21 changes: 16 additions & 5 deletions resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def vkpass_streams(url, recursive_call=False):
html = response.read()
response.close()
#with open("vkpass.html", "w") as f:
#f.write(html)
# f.write(html)
except Exception, e:
return None

Expand Down Expand Up @@ -174,7 +174,7 @@ def vkpass_streams(url, recursive_call=False):
more_streams = _vkpass_streams_from_html(html, recursive_call)
if more_streams and len(more_streams) > 0:
streams += more_streams
except:
except Exception, e:
pass

return streams
Expand All @@ -185,7 +185,7 @@ def _extract_packed_videourls(html):
eval_end = html.find('</script>', eval_start)
packed_script = html[eval_start: eval_end]
unpacked_script = packer.unpack(packed_script)
return _extract_source_tags(unpacked_script)
return unpacked_script


def _extract_source_tags(html):
Expand All @@ -209,7 +209,10 @@ def _extract_videoz_url(html):

def _extract_jawcloud(html):
try:
url = re.search('<source src="(.*?)"', html).group(1)
url = re.search('<source src="(.*?)"', html)
if not url:
url = re.search('src="(.*?)"', html)
url = url.group(1)
except Exception, e:
pass

Expand All @@ -228,7 +231,7 @@ def _vkpass_streams_from_html(html, recursive_call):

# Look for p,a,c,k,e,d js files
if html.find('eval(function(p,a,c,k,e') != -1:
return _extract_packed_videourls(html)
html = _extract_packed_videourls(html)

# Look for video tag
source_tags = re.findall(r'(<source.*?\/>)', html)
Expand All @@ -238,6 +241,14 @@ def _vkpass_streams_from_html(html, recursive_call):
# Look for jawcloud
if re.findall("\$\.get\('https://jawcloud\.co", html):
return _extract_jawcloud(html)
if re.findall('src="https://jawcloud\.co', html):
url = re.search('src="(.*?)"', html).group(1)
req = urllib2.Request(url)
response = urllib2.urlopen(req)
html = response.read()
response.close()
return _extract_jawcloud(html)


identifier = "vsource=["

Expand Down

0 comments on commit b00798e

Please sign in to comment.