Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
Switch to caching proxy for data
Browse files Browse the repository at this point in the history
  • Loading branch information
piplongrun authored May 1, 2017
1 parent 8092896 commit 73ef0ab
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Contents/Services/URL/MUVIO/ServiceCode.pys
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import ssl, urllib2

RE_VIDEOS = Regex('"quality":"(medium|high)".+?"url":"([^"]+)"')

####################################################################################################
Expand Down Expand Up @@ -32,10 +30,8 @@ def PlayVideo(url, resolution='720', **kwargs):
video_url_high = None
video_url_med = None

req = urllib2.Request(url.replace('muvio://', 'https://'))
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
page = urllib2.urlopen(req, context=ctx).read()

url = 'https://proxy.tadata.me/watch/%s' % (url.split('/watch/')[-1])
page = HTTP.Request(url, cacheTime=CACHE_1HOUR).content
videos = RE_VIDEOS.findall(page)

for video in videos:
Expand Down

0 comments on commit 73ef0ab

Please sign in to comment.