-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes Desi-Tashan, added new host TVLogy
- Loading branch information
1 parent
594c75a
commit 949b3f6
Showing
8 changed files
with
103 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import string, re | ||
|
||
HTTP_HEADERS = { | ||
'Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', | ||
'Accept-Encoding: gzip, deflate', | ||
'Accept-Language: en-US,en;q=0.5', | ||
'Connection: keep-alive', | ||
'Referer: http://www.tvlogy.to', | ||
'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0' | ||
} | ||
|
||
ART = 'http://i.imgur.com/GwSnkxE.jpg' | ||
COVER = 'http://i.imgur.com/0snKSZt.png' | ||
|
||
######################################################################################## | ||
def NormalizeURL(url): | ||
|
||
return url | ||
|
||
#################################################################################################### | ||
def MetadataObjectForURL(url): | ||
|
||
try: | ||
page_data = HTTP.Request(url).content | ||
|
||
img = re.findall(r'http.*jpg', page_data)[0] | ||
thumb = img | ||
except: | ||
thumb = url | ||
|
||
title = 'TvLogy Redirect Page' | ||
summary = 'Summary info Page' | ||
|
||
return VideoClipObject( | ||
title = title, | ||
summary = summary, | ||
art = Resource.ContentsOfURLWithFallback([thumb,ART]), | ||
thumb = Resource.ContentsOfURLWithFallback([thumb,COVER]) | ||
) | ||
|
||
#################################################################################################### | ||
def MediaObjectsForURL(url): | ||
|
||
return [ | ||
MediaObject( | ||
video_codec = VideoCodec.H264, | ||
audio_codec = AudioCodec.AAC, | ||
audio_channels = 2, | ||
video_resolution = '720', | ||
optimized_for_streaming = True, | ||
parts = [PartObject(key=Callback(PlayVideo, url=url, quality='hd'))] | ||
) | ||
] | ||
|
||
#################################################################################################### | ||
@indirect | ||
def PlayVideo(url, quality): | ||
|
||
try: | ||
page_data = HTTP.Request(url).content | ||
#Log(page_data) | ||
match = re.findall(r'http.*m3u8', page_data)[0] | ||
if '.m3u8.m3u8' in match: | ||
match = re.findall(r'http.(.+http).(.+m3u8).m3u8', page_data)[2] | ||
|
||
#Log(match) | ||
url0 = match | ||
except: | ||
url0 = url | ||
|
||
return IndirectResponse(VideoClipObject, key=HTTPLiveStreamURL(url0)) |