Skip to content

Commit

Permalink
Removed hls support in Vidzi, corrects Chromecast error
Browse files Browse the repository at this point in the history
added new valid site URL
  • Loading branch information
Twoure committed May 10, 2016
1 parent eae7bb3 commit b5b7461
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
5 changes: 4 additions & 1 deletion Contents/DefaultPrefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"id": "pw_site_url",
"type": "enum",
"label": "Site URL",
"values": ["http://www.primewire.ag", "http://www.primewire.is", "http://www.primewire.org", "http://primewire.filespook.com", "http://hdmovieas.org"],
"values": [
"http://www.primewire.ag", "http://www.primewire.is", "http://www.primewire.org",
"http://primewire.filespook.com", "http://hdmovieas.org", "http://primeware.win"
],
"default": "http://www.primewire.ag"
},
{
Expand Down
39 changes: 11 additions & 28 deletions Contents/Services/URL/Vidzi/ServiceCode.pys
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,18 @@ def MediaObjectsForURL(url):

return [
MediaObject(
video_resolution = 'sd',
audio_channels = 2,
optimized_for_streaming = False,
parts = [
PartObject(key=Callback(PlayVideo, url=url, mp4=True))
]
),
MediaObject(
video_resolution = 'sd',
parts = [
PartObject(key=HTTPLiveStreamURL(Callback(PlayVideo, url=url, mp4=False)))
]
)
]
video_resolution='sd',
audio_channels=2,
optimized_for_streaming=False,
parts=[
PartObject(key=Callback(PlayVideo, url=url))
]
)
]

####################################################################################################
@indirect
def PlayVideo(url, mp4, **kwargs):
def PlayVideo(url, **kwargs):

# Trick to use the bundled Vidzi ULR Service
url = url.replace('vidzi://', 'http://')
Expand All @@ -71,20 +65,9 @@ def PlayVideo(url, mp4, **kwargs):
data = Regex("<script type=.text\/javascript.>(eval\(function\(p,a,c,k,e,.+\.split\('\|'\)\)\))").search(page)

if data:

data = Unpack(data.group(1))
if mp4:
file = Regex('file:"([^"]+\.mp4)"').search(data)
if file:
file = file.group(1)
else:
file = Regex('file:"([^"]+\.m3u8.*?)"').search(data)
if file:
file = file.group(1)
if not file.endswith('m3u8'):
file = file.split('.m3u8')[0]+'.m3u8'

file = Regex('file:"([^"]+\.mp4)"').search(data)
if file:
return IndirectResponse(VideoClipObject, key=file)
return IndirectResponse(VideoClipObject, key=file.group(1))

raise Ex.MediaNotAvailable

0 comments on commit b5b7461

Please sign in to comment.