Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Fixes:
- Bookmarking bug when no thumb
- Provider 3DOnlineFilms

New:
- Define your own Base URL option (settings)
  • Loading branch information
coder-alpha committed Apr 19, 2019
1 parent 6d8362b commit bb2e87c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Contents/Code/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
TITLE = "FMoviesPlus"
VERSION = '0.82' # Release notation (x.y - where x is major and y is minor)
VERSION = '0.83' # Release notation (x.y - where x is major and y is minor)
TAG = ''
GITHUB_REPOSITORY = 'coder-alpha/FMoviesPlus.bundle'
PREFIX = "/video/fmoviesplus"
Expand Down Expand Up @@ -218,6 +218,7 @@
ICON_ENTER = "icon-enter.png"
ICON_QUEUE = "icon-bookmark.png"
ICON_UNAV = "MoviePosterUnavailable.jpg"
ICON_UNAV_URL = "https://i.imgur.com/IBo6qDY.png"
ICON_PREFS = "icon-prefs.png"
ICON_UPDATE = "icon-update.png"
ICON_UPDATE_NEW = "icon-update-new.png"
Expand Down
27 changes: 19 additions & 8 deletions Contents/Code/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
@route(PREFIX + "/MainMenu")
def MainMenu(**kwargs):

fmovies.BASE_URL = Prefs["new_base_url"]
T_BASE_URL = Prefs["new_base_url_txt"]
if T_BASE_URL!= None and T_BASE_URL != "":
fmovies.BASE_URL = T_BASE_URL
else:
fmovies.BASE_URL = Prefs["new_base_url"]
if common.CHECK_BASE_URL_REDIRECTION == True and common.CHECK_BASE_URL_REDIRECTION_HP == True:
try:
RED_URL = common.client.getRedirectingUrl(fmovies.BASE_URL).strip("/")
Expand Down Expand Up @@ -3906,7 +3910,7 @@ def EpisodeDetail(title, url, thumb, session, dataEXS=None, dataEXSAnim=None, **
oc.add(DirectoryObject(
key = Callback(RemoveBookmark, title = title, url = url),
title = "Remove Bookmark",
summary = 'Removes the current %s from the Boomark que' % (itemtype),
summary = 'Removes the current %s from the Boomark queue' % (itemtype),
art = art,
thumb = common.GetThumb(R(common.ICON_QUEUE), session=session)
)
Expand All @@ -3915,7 +3919,7 @@ def EpisodeDetail(title, url, thumb, session, dataEXS=None, dataEXSAnim=None, **
oc.add(DirectoryObject(
key = Callback(AddBookmark, title = title, url = url, summary=summary, thumb=thumb, type='movie' if isTvSeries==False else 'series'),
title = "Add Bookmark",
summary = 'Adds the current %s to the Boomark que' % (itemtype),
summary = 'Adds the current %s to the Boomark queue' % (itemtype),
art = art,
thumb = common.GetThumb(R(common.ICON_QUEUE), session=session)
)
Expand Down Expand Up @@ -5651,6 +5655,8 @@ def AddBookmark(title, url, summary, thumb, type='movie', silent=False, data=Non
if Check(title=title, url=url):
return MC.message_container(title, 'This item has already been added to your bookmarks.')

if str(thumb) == 'None' or str(thumb) == '':
thumb = COMMON.ICON_UNAV_URL
#Log("Added : %s %s" % (title, url))
if data != None:
Dict[title+'-'+E(url)] = (title + 'Key5Split' + data +'Key5Split'+ summary + 'Key5Split' + thumb + 'Key5Split' + type)
Expand Down Expand Up @@ -6018,15 +6024,15 @@ def Search(query=None, surl=None, page_count='1', mode='default', thumb=None, su
oc.add(DirectoryObject(
key = Callback(RemoveBookmark, title = query + ' (All Seasons)', url = url),
title = "Remove Bookmark",
summary = 'Removes the current show season from the Boomark que',
summary = 'Removes the current show season from the Boomark queue',
thumb = R(common.ICON_QUEUE)
)
)
else:
oc.add(DirectoryObject(
key = Callback(AddBookmark, title = query + ' (All Seasons)', url = url, summary=summary, thumb=thumb, type='series'),
title = "Add Bookmark",
summary = 'Adds the current show season to the Boomark que',
summary = 'Adds the current show season to the Boomark queue',
thumb = R(common.ICON_QUEUE)
)
)
Expand Down Expand Up @@ -6135,7 +6141,7 @@ def SearchExt(query=None, query2=None, session=None, xtitle=None, xyear=None, xt
oc.add(DirectoryObject(
key = Callback(AddBookmark, title=xtitle, url=urld, summary=xsummary, thumb=xthumb, type=xtype, data=urldata),
title = "Add Bookmark",
summary = 'Adds the current Show to the Boomark que',
summary = 'Adds the current Show to the Boomark queue',
thumb = common.GetThumb(R(common.ICON_QUEUE), session=session)
)
)
Expand Down Expand Up @@ -6413,7 +6419,7 @@ def DoIMDBExtSources(title, year, type, imdbid, season=None, episode=None, episo
oc.add(DirectoryObject(
key = Callback(AddBookmark, title=title, url=urld, summary=summary, thumb=thumb, type=type, data=urldata),
title = "Add Bookmark",
summary = 'Adds the current Show to the Boomark que',
summary = 'Adds the current Show to the Boomark queue',
thumb = common.GetThumb(R(common.ICON_QUEUE), session=session)
)
)
Expand Down Expand Up @@ -7598,7 +7604,12 @@ def ValidatePrefs2(changed='True', **kwargs):
if str(changed) == 'True':
Log("Your Channel Preferences have changed !")

fmovies.BASE_URL = Prefs["new_base_url"]
T_BASE_URL = Prefs["new_base_url_txt"]
if T_BASE_URL!= None and T_BASE_URL != "":
fmovies.BASE_URL = T_BASE_URL
else:
fmovies.BASE_URL = Prefs["new_base_url"]

RED_URL = None
if fmovies.BASE_URL != Prefs["new_base_url"] or str(changed) == 'True':
if common.CHECK_BASE_URL_REDIRECTION == True:
Expand Down
2 changes: 1 addition & 1 deletion Contents/DefaultPrefs.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ { "id": "new_base_url", "label": "Base site url", "type": "enum", "values": ["https://bmovies.is","https://bmovies.to","https://bmovies.pro","https://bmovies.online","https://bmovies.club","https://bmovies.ru","https://fmovies.to","https://fmovies.is","https://fmovies.se","https://fmovies.taxi","https://ffmovies.ru"], "default": "https://fmovies.taxi" }, { "id": "use_quick_init", "label": "Enable quick Initialization (Disable this when diagnosing issues)", "type": "bool", "default": "false" }, { "id": "cache_expiry_time", "label": "Cache Expiry Time (in mins.)", "type": "text", "default": "100" }, { "id": "dont_fetch_more_info", "label": "No Extra Info. for Nav. Pages (Speeds Up Navigation)", "type": "bool", "default": "false" }, { "id": "use_https_alt", "label": "Use Alternate SSL/TLS", "type": "bool", "default": "false" }, { "id": "use_web_proxy", "label": "Use SSL Web-Proxy", "type": "bool", "default": "false" }, { "id": "disable_extsources", "label": "Disable External Sources", "type": "bool", "default": "false" }, { "id": "disable_downloader", "label": "Disable Downloading Sources (Please read Plex Privacy policy)", "type": "bool", "default": "true" }, { "id": "control_concurrent_src_threads", "label": "Number of concurrent Source Searching Threads", "type": "enum", "values": ["2","3","4","5","6","7","8","9","10","12","14","16","18","20","25","30","40","50"], "default": "4" }, { "id": "download_connections", "label": "Number of concurrent Download Threads", "type": "enum", "values": ["1","2","3","4","5","6","7","8","9","10"], "default": "2" }, { "id": "download_speed_limit", "label": "Limit Aggregate Download Speed (KB/s)", "type": "enum", "values": ["0","128","256","512","1024","2048","5120","10240","20480","30720","40960","51200"], "default": "0" }, { "id": "autopilot_schedule", "label": "AutoPilot Scheduled Time to Run in the day", "type": "enum", "values": ["0","1","2","3","4","5","6","7","8","9","10","12","13","14","15","16","17","18","19","20","21","22","23"], "default": "4" }, { "id": "use_linkchecker", "label": "Use LinkChecker for Videos", "type": "bool", "default": "false" }, { "id": "ca_api_key", "label": "External Sources Search API Key", "type": "text", "option": "hidden", "secure": "true", "default": "UTBFeU1ERTM=" }, { "id": "control_flixanity_user_pass", "label": "Flixanity User:Pass (Signup: https://flixanity.mobi", "type": "text", "option": "hidden", "secure": "true", "default": "" }, { "id": "control_videospider_api_key", "label": "VideoSpider API_Key:Secret_Key (Signup: https://videospider.in/signup.php)", "type": "text", "option": "hidden", "secure": "true", "default": "" }, { "id": "use_openload_pairing", "label": "Use OpenLoad (PhantomJS is primary, API Login:Key is secondary followed by Pairing. Disabled uses USS as primary)", "type": "bool", "default": "true" }, { "id": "use_phantomjs", "label": "Use PhantomJS (Binary download required)", "type": "enum", "values": ["No","Yes - Threads Only","Yes - Universally"], "default": "No" }, { "id": "control_phantomjs_path", "label": "Absolute path to PhantomJS folder (folder containing the binary file)", "type": "text", "default": "" }, { "id": "plextv", "label": "Auth Admin through Plex.tv (else use localhost)", "type": "bool", "default": "false" }, { "id": "use_debug", "label": "Enable Debug Mode (might show IP and computer Username in Logs)", "type": "bool", "default": "false" }]
[ { "id": "new_base_url_txt", "label": "Base site url", "type": "text", "default": "" }, { "id": "new_base_url", "label": "Base site url", "type": "enum", "values": ["https://bmovies.is","https://bmovies.to","https://bmovies.pro","https://bmovies.online","https://bmovies.club","https://bmovies.ru","https://fmovies.to","https://fmovies.is","https://fmovies.se","https://fmovies.taxi","https://ffmovies.ru"], "default": "https://fmovies.taxi" }, { "id": "use_quick_init", "label": "Enable quick Initialization (Disable this when diagnosing issues)", "type": "bool", "default": "false" }, { "id": "cache_expiry_time", "label": "Cache Expiry Time (in mins.)", "type": "text", "default": "100" }, { "id": "dont_fetch_more_info", "label": "No Extra Info. for Nav. Pages (Speeds Up Navigation)", "type": "bool", "default": "false" }, { "id": "use_https_alt", "label": "Use Alternate SSL/TLS", "type": "bool", "default": "false" }, { "id": "use_web_proxy", "label": "Use SSL Web-Proxy", "type": "bool", "default": "false" }, { "id": "disable_extsources", "label": "Disable External Sources", "type": "bool", "default": "false" }, { "id": "disable_downloader", "label": "Disable Downloading Sources (Please read Plex Privacy policy)", "type": "bool", "default": "true" }, { "id": "control_concurrent_src_threads", "label": "Number of concurrent Source Searching Threads", "type": "enum", "values": ["2","3","4","5","6","7","8","9","10","12","14","16","18","20","25","30","40","50"], "default": "4" }, { "id": "download_connections", "label": "Number of concurrent Download Threads", "type": "enum", "values": ["1","2","3","4","5","6","7","8","9","10"], "default": "2" }, { "id": "download_speed_limit", "label": "Limit Aggregate Download Speed (KB/s)", "type": "enum", "values": ["0","128","256","512","1024","2048","5120","10240","20480","30720","40960","51200"], "default": "0" }, { "id": "autopilot_schedule", "label": "AutoPilot Scheduled Time to Run in the day", "type": "enum", "values": ["0","1","2","3","4","5","6","7","8","9","10","12","13","14","15","16","17","18","19","20","21","22","23"], "default": "4" }, { "id": "use_linkchecker", "label": "Use LinkChecker for Videos", "type": "bool", "default": "false" }, { "id": "ca_api_key", "label": "External Sources Search API Key", "type": "text", "option": "hidden", "secure": "true", "default": "UTBFeU1ERTM=" }, { "id": "control_flixanity_user_pass", "label": "Flixanity User:Pass (Signup: https://flixanity.mobi", "type": "text", "option": "hidden", "secure": "true", "default": "" }, { "id": "control_videospider_api_key", "label": "VideoSpider API_Key:Secret_Key (Signup: https://videospider.in/signup.php)", "type": "text", "option": "hidden", "secure": "true", "default": "" }, { "id": "use_openload_pairing", "label": "Use OpenLoad (PhantomJS is primary, API Login:Key is secondary followed by Pairing. Disabled uses USS as primary)", "type": "bool", "default": "true" }, { "id": "use_phantomjs", "label": "Use PhantomJS (Binary download required)", "type": "enum", "values": ["No","Yes - Threads Only","Yes - Universally"], "default": "No" }, { "id": "control_phantomjs_path", "label": "Absolute path to PhantomJS folder (folder containing the binary file)", "type": "text", "default": "" }, { "id": "plextv", "label": "Auth Admin through Plex.tv (else use localhost)", "type": "bool", "default": "false" }, { "id": "use_debug", "label": "Enable Debug Mode (might show IP and computer Username in Logs)", "type": "bool", "default": "false" }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ def get_movie(self, imdb, title, year, proxy_options=None, key=None, testing=Fal
break

if len(url_data) > 0:

links_data = []

for data in url_data:
Expand All @@ -220,23 +219,31 @@ def get_movie(self, imdb, title, year, proxy_options=None, key=None, testing=Fal
data = client.parseDOM(data, 'div', attrs = {'class': 'view'})[0]
url = client.parseDOM(data, 'a', ret='href')[0].strip()
titlex = client.parseDOM(data, 'img', ret='alt')[0]
except:
break
except Exception as e:
log(type='INFO', method='get_movie-3-A', err='%s' % e, dolog=False, logToControl=False, doPrint=True)
if len(titlex) == 0 and url == 'player.php?title=':
log(type='INFO', method='get_movie-3', err='No results for: %s' % xtitle, dolog=True, logToControl=False, doPrint=True)
log(type='INFO', method='get_movie-3-B', err='No results for: %s' % xtitle, dolog=True, logToControl=False, doPrint=True)
else:
url = urlparse.urljoin(self.base_link, url)
try:
poster = urlparse.urljoin(self.base_link_alts[0], client.parseDOM(data, 'img', ret='src')[0])
except:
poster = None

log(type='INFO', method='get_movie-3-C', err='Matching - %s' % url, dolog=False, logToControl=False, doPrint=True)
if title in titlex.lower() or titlex.lower() in title or lose_match_title(title, titlex.lower()):
url = url.replace(' ','%20')
url = client.request(url, headers=headers, followredirect=True, output='geturl')
url = client.request(url, headers=headers, followredirect=True, output='geturl')
result = proxies.request(url, proxy_options=proxy_options, use_web_proxy=self.proxyrequired, headers=headers, timeout=60)
url = client.parseDOM(result, 'frame', ret = 'src')[0]

try:
url = client.parseDOM(result, 'frame', ret = 'src')[0]
except:
try:
url = client.parseDOM(result, 'iframe', ret = 'src')[0]
except:
pass

if url != 'https://www.freedocufilms.com/player.php?title=':
log(type='INFO', method='get_movie-3A', err='Verifying - %s' % url, dolog=True, logToControl=False, doPrint=True)
Expand Down

0 comments on commit bb2e87c

Please sign in to comment.