Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-alpha committed Apr 13, 2017
1 parent 9927cec commit 1ffacf9
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Contents/Code/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

################################################################################
TITLE = "FMoviesPlus"
VERSION = '0.13' # Release notation (x.y - where x is major and y is minor)
VERSION = '0.14' # Release notation (x.y - where x is major and y is minor)
GITHUB_REPOSITORY = 'coder-alpha/FMoviesPlus.bundle'
PREFIX = "/video/fmoviesplus"
################################################################################
Expand Down Expand Up @@ -179,6 +179,8 @@ def GetPageAsString(url, headers=None, timeout=15):
else:
page_data_string = HTTP.Request(fmovies.PROXY_URL + url, headers=headers, timeout=timeout).content
page_data_string = page_data_string.replace(fmovies.PROXY_PART1, fmovies.PROXY_PART1_REPLACE)
page_data_string = page_data_string.replace(fmovies.PROXY_PART1B, fmovies.PROXY_PART1_REPLACE)
page_data_string = page_data_string.replace(fmovies.PROXY_PART1C, fmovies.PROXY_PART1_REPLACE)
page_data_string = page_data_string.replace(fmovies.PROXY_PART2A, fmovies.PROXY_PART2_REPLACE)
page_data_string = page_data_string.replace(fmovies.PROXY_PART2B, fmovies.PROXY_PART2_REPLACE)
else:
Expand Down
56 changes: 53 additions & 3 deletions Contents/Code/fmovies.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#
#########################################################################################################

import urllib, urllib2, urlparse, json, time, re, sys, HTMLParser, random, cookielib, datetime, calendar

import urllib, urllib2, urlparse, json, time, re, sys, HTMLParser, random, cookielib, datetime, calendar, base64
from __builtin__ import ord
Constants = SharedCodeService.constants

CACHE = {}
Expand All @@ -29,6 +29,8 @@
# SSL Web Proxy
PROXY_URL = "https://ssl-proxy.my-addr.org/myaddrproxy.php/"
PROXY_PART1 = "/myaddrproxy.php/https/fmovies.to/"
PROXY_PART1B = "/myaddrproxy.php/https/fmovies.se/"
PROXY_PART1C = "/myaddrproxy.php/https/fmovies.is/"
PROXY_PART1_REPLACE = "/"
PROXY_PART2A = "/myaddrproxy.php/https/"
PROXY_PART2B = "/myaddrproxy.php/http/"
Expand Down Expand Up @@ -109,6 +111,8 @@ def GetApiUrl(url, key, serverts=0):
elif use_web_proxy:
json_data_string = HTTP.Request(PROXY_URL + ret).content
json_data_string = json_data_string.replace(PROXY_PART1, PROXY_PART1_REPLACE)
json_data_string = json_data_string.replace(PROXY_PART1B, PROXY_PART1_REPLACE)
json_data_string = json_data_string.replace(PROXY_PART1C, PROXY_PART1_REPLACE)
json_data_string = json_data_string.replace(PROXY_PART2A, PROXY_PART2_REPLACE)
json_data_string = json_data_string.replace(PROXY_PART2B, PROXY_PART2_REPLACE)
try:
Expand Down Expand Up @@ -217,6 +221,8 @@ def get_sources(url, key, use_debug=True, serverts=0, myts=0, use_https_alt=Fals
result = request(hash_url, headers=headers, limit='0', webproxy=webproxy)
if webproxy != None:
result = result.replace(PROXY_PART1, PROXY_PART1_REPLACE)
result = result.replace(PROXY_PART1B, PROXY_PART1_REPLACE)
result = result.replace(PROXY_PART1C, PROXY_PART1_REPLACE)
result = result.replace(PROXY_PART2A, PROXY_PART2_REPLACE)
result = result.replace(PROXY_PART2B, PROXY_PART2_REPLACE)
#print result
Expand Down Expand Up @@ -247,7 +253,7 @@ def get_sources(url, key, use_debug=True, serverts=0, myts=0, use_https_alt=Fals
except:
return magic_url, isOpenLoad

def get_token(data):
def get_token_(data):

index1 = 0
sn = 256
Expand All @@ -272,6 +278,50 @@ def get_token(data):
index4 += ord(data[index2][index8]) ^ (i[(i[s] +i[n]) % sn]) * index8 + index8
index1 += index4
return {'_': str(index1)}

def r01(e, n):
v = t01(e, n);
return v

def t01(t, e):
T = ""
sn = 256
o = list(range(0, sn))
for r in range(0, sn):
o[r] = r
i = 0
for r in range(0,sn):
i = (i + o[r] + ord(t[(r % len(t))])) % sn
n = o[r]
o[r] = o[i]
o[i] = n
r = 0
i = 0
a = T
for s in range(0, len(e)):
r = (r + 1) % sn
i = (i + o[r]) % sn
n = o[r]
o[r] = o[i]
o[i] = n
a += chr(ord(e[s]) ^ o[(o[r] + o[i]) % sn])
return T + a

def a01(t):
i = 0
for e in range(0, len(t)):
i += ord(t[e])
return i

def get_token(n, **kwargs):
try:
d = base64.b64decode(base64.b64decode("UWxFMFFYZENaMVJTZW5CQ1lsTkxURUk9"))
s = a01(d)
for i in n:
s += a01(r01(d + i, n[i]))
return {'_': str(s)}
except Exception as e:
Log("fmovies.py > get_token > %s" % e)


#########################################################################################################
Expand Down

0 comments on commit 1ffacf9

Please sign in to comment.