diff --git a/Contents/Code/__init__.py b/Contents/Code/__init__.py index 49c864b..871a005 100644 --- a/Contents/Code/__init__.py +++ b/Contents/Code/__init__.py @@ -37,7 +37,7 @@ PROXY_PART2_REPLACE = "/" LAST_PROCESSED_URL = [] VideoURL = {} -EINTHUSAN_SERVERS = ["Dallas","Washington","San Jose","Somerville","Toronto","London","Sydney"] +EINTHUSAN_SERVERS = ["Dallas","Washington","Los Angeles","London"] EINTHUSAN_SERVER_INFO = {} SLIMERJS_INIT = [] @@ -578,10 +578,10 @@ def AllAvailableSources(furl, title, summary, thumb, year, rating, art, **kwargs def AllAvailableSources2(furl, title, summary, thumb, year, rating, art, location, **kwargs): oc = ObjectContainer(title1 = unicode(title), art=thumb) - vidpath = furl.split('.tv/')[1] + vidpath = furl.split('.io/')[1] for idx in EINTHUSAN_SERVER_INFO[location]["Servers"]: - furl = ("https://s" + str(idx+SERVER_OFFSET[0]) + ".einthusan.tv/" + vidpath) + furl = ("https://cdn" + str(idx+SERVER_OFFSET[0]) + ".einthusan.io/" + vidpath) ret_code = GetHttpStatus(url=furl) if ret_code == "200": oc.add(VideoClipObject( @@ -602,19 +602,19 @@ def AvailableSourceFrom(furl, location, **kwargs): location = 'San Jose' try: - vidpath = furl.split('.tv/')[1] + vidpath = furl.split('.io/')[1] choice_str = str(random.choice(EINTHUSAN_SERVER_INFO[location]["Servers"]) + SERVER_OFFSET[0]) except: choice_str = '1' - url = ("https://s" + choice_str + ".einthusan.tv/" + vidpath) + url = ("https://cdn" + choice_str + ".einthusan.io/" + vidpath) ret_code = GetHttpStatus(url=url) return url, choice_str, ret_code @route(PREFIX + "/DetermineCurrentServer") def DetermineCurrentServer(furl, location, **kwargs): - server_n = furl.split('.einthusan.tv')[0].strip('https://s') + server_n = furl.split('.einthusan.io')[0].strip('https://cdn') del SERVER_OFFSET[:] if int(server_n) > 100: @@ -645,47 +645,28 @@ def AddSourceInfo(): AUS_FLAG = "icon-aus.png" EINTHUSAN_SERVER_INFO["Dallas"] = {} - EINTHUSAN_SERVER_INFO["Dallas"]["Servers"]=[23,24,25,29,30,31,35,36,37,38,45] + EINTHUSAN_SERVER_INFO["Dallas"]["Servers"]=[2] EINTHUSAN_SERVER_INFO["Dallas"]["Country"]="US" EINTHUSAN_SERVER_INFO["Dallas"]["State"]="TX" EINTHUSAN_SERVER_INFO["Dallas"]["Flag"]=US_FLAG EINTHUSAN_SERVER_INFO["Washington"] = {} - EINTHUSAN_SERVER_INFO["Washington"]["Servers"]=[1,2,3,4,5,6,7,8,9,10,11,13,41,44] + EINTHUSAN_SERVER_INFO["Washington"]["Servers"]=[1] EINTHUSAN_SERVER_INFO["Washington"]["Country"]="US" EINTHUSAN_SERVER_INFO["Washington"]["State"]="D.C." EINTHUSAN_SERVER_INFO["Washington"]["Flag"]=US_FLAG - EINTHUSAN_SERVER_INFO["San Jose"] = {} - EINTHUSAN_SERVER_INFO["San Jose"]["Servers"]=[19,20,21,22,46] - EINTHUSAN_SERVER_INFO["San Jose"]["Country"]="US" - EINTHUSAN_SERVER_INFO["San Jose"]["State"]="CA" - EINTHUSAN_SERVER_INFO["San Jose"]["Flag"]=US_FLAG - - EINTHUSAN_SERVER_INFO["Somerville"] = {} - EINTHUSAN_SERVER_INFO["Somerville"]["Servers"]=[12] - EINTHUSAN_SERVER_INFO["Somerville"]["Country"]="US" - EINTHUSAN_SERVER_INFO["Somerville"]["State"]="MA" - EINTHUSAN_SERVER_INFO["Somerville"]["Flag"]=US_FLAG - - EINTHUSAN_SERVER_INFO["Toronto"] = {} - EINTHUSAN_SERVER_INFO["Toronto"]["Servers"]=[26,27] - EINTHUSAN_SERVER_INFO["Toronto"]["Country"]="Canada" - EINTHUSAN_SERVER_INFO["Toronto"]["State"]="" - EINTHUSAN_SERVER_INFO["Toronto"]["Flag"]=CAN_FLAG - - EINTHUSAN_SERVER_INFO["London"] = {} - EINTHUSAN_SERVER_INFO["London"]["Servers"]=[14,15,16,17,18,32,33,39,40,42] - EINTHUSAN_SERVER_INFO["London"]["Country"]="UK" - EINTHUSAN_SERVER_INFO["London"]["State"]="" - EINTHUSAN_SERVER_INFO["London"]["Flag"]=UK_FLAG - - EINTHUSAN_SERVER_INFO["Sydney"] = {} - EINTHUSAN_SERVER_INFO["Sydney"]["Servers"]=[28,34,43] - EINTHUSAN_SERVER_INFO["Sydney"]["Country"]="Australia" - EINTHUSAN_SERVER_INFO["Sydney"]["State"]="" - EINTHUSAN_SERVER_INFO["Sydney"]["Flag"]=AUS_FLAG + EINTHUSAN_SERVER_INFO["Los Angeles"] = {} + EINTHUSAN_SERVER_INFO["Los Angeles"]["Servers"] = [3] + EINTHUSAN_SERVER_INFO["Los Angeles"]["Country"] = "US" + EINTHUSAN_SERVER_INFO["Los Angeles"]["State"] = "CA" + EINTHUSAN_SERVER_INFO["Los Angeles"]["Flag"] = US_FLAG + EINTHUSAN_SERVER_INFO["London"] = {} + EINTHUSAN_SERVER_INFO["London"]["Servers"] = [4] + EINTHUSAN_SERVER_INFO["London"]["Country"] = "UK" + EINTHUSAN_SERVER_INFO["London"]["State"] = "" + EINTHUSAN_SERVER_INFO["London"]["Flag"] = UK_FLAG def find_between( s, first, last ): try: @@ -707,7 +688,7 @@ def Bookmarks(title, **kwargs): url = Dict[each] #Log("url-----------" + url) if url.find(TITLE.lower()) != -1 and 'http' in url and '.mp4' not in url: - if 'einthusan.com' in url: + if 'einthusan.tv' in url: url = GetRedirector(url) Dict[each] = url oc.add(DirectoryObject( @@ -909,4 +890,4 @@ def GetHttpStatus(url, **kwargs): if Prefs['use_debug']: Log('Error > GetHttpStatus: ' + str(e)) Log(url +' : HTTPResponse = '+ resp) - return resp \ No newline at end of file + return resp diff --git a/Contents/DefaultPrefs.json b/Contents/DefaultPrefs.json index 566b4fe..2837a94 100644 --- a/Contents/DefaultPrefs.json +++ b/Contents/DefaultPrefs.json @@ -1 +1,52 @@ -[ { "id": "langPref", "label": "Language", "type": "enum", "values": ["hindi","tamil","telugu","malayalam","kannada","bengali","marathi","punjabi"], "default": "hindi" }, { "id": "locationPref", "label": "Preferred Location", "type": "enum", "values": ["Dallas","Washington","San Jose","Somerville","Toronto","London","Sydney"], "default": "Washington" }, { "id": "use_https_alt", "label": "Use Alternate SSL/TLS", "type": "bool", "default": "false" }, { "id": "use_proxy", "label": "Use proxy for connection", "type": "bool", "default": "false" }, { "id": "use_slimerjs", "label": "Use SlimerJS (define paths below)", "type": "bool", "default": "false" }, { "id": "python_dir", "label": "Python directory (for Linux only)", "type": "text", "default": "/usr/local/bin/python" }, { "id": "firefox_dir", "label": "Firefox directory (eg. C:\\Program Files (x86)\\Mozilla Firefox\\)", "type": "text", "default": "" }, { "id": "use_debug", "label": "Enable Debug Mode", "type": "bool", "default": "false" } ] \ No newline at end of file +[ + { + "id": "langPref", + "label": "Language", + "type": "enum", + "values": ["hindi","tamil","telugu","malayalam","kannada","bengali","marathi","punjabi"], + "default": "hindi" + }, + { + "id": "locationPref", + "label": "Preferred Location", + "type": "enum", + "values": ["Dallas","Washington","Los Angeles","London"], + "default": "Washington" + }, + { + "id": "use_https_alt", + "label": "Use Alternate SSL/TLS", + "type": "bool", + "default": "false" + }, + { + "id": "use_proxy", + "label": "Use proxy for connection", + "type": "bool", + "default": "false" + }, + { + "id": "use_slimerjs", + "label": "Use SlimerJS (define paths below)", + "type": "bool", + "default": "false" + }, + { + "id": "python_dir", + "label": "Python directory (for Linux only)", + "type": "text", + "default": "/usr/local/bin/python" + }, + { + "id": "firefox_dir", + "label": "Firefox directory (eg. C:\\Program Files (x86)\\Mozilla Firefox\\)", + "type": "text", + "default": "" + }, + { + "id": "use_debug", + "label": "Enable Debug Mode", + "type": "bool", + "default": "false" + } +] \ No newline at end of file