Probabile Fix Autoplay Torrent
This commit is contained in:
+1
-1
@@ -103,7 +103,7 @@ def start(itemlist, item):
|
|||||||
pass
|
pass
|
||||||
# sleep(3)
|
# sleep(3)
|
||||||
try:
|
try:
|
||||||
if platformtools.is_playing():
|
if platformtools.is_playing() or autoplay_elem.server == 'torrent':
|
||||||
PLAYED = True
|
PLAYED = True
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ def download(item=None):
|
|||||||
support.info('URL:', url)
|
support.info('URL:', url)
|
||||||
if url:
|
if url:
|
||||||
dl = downloadtools.downloadfile(host + url, filename)
|
dl = downloadtools.downloadfile(host + url, filename)
|
||||||
|
if dl == -3:
|
||||||
|
filetools.remove(filename)
|
||||||
|
dl = downloadtools.downloadfile(host + url, filename)
|
||||||
if dl == None:
|
if dl == None:
|
||||||
extract()
|
extract()
|
||||||
xbmc.sleep(1000)
|
xbmc.sleep(1000)
|
||||||
|
|||||||
@@ -1478,6 +1478,7 @@ def play_torrent(item, xlistitem, mediaurl):
|
|||||||
from servers import torrent
|
from servers import torrent
|
||||||
|
|
||||||
torrent_options = torrent_client_installed(show_tuple=True)
|
torrent_options = torrent_client_installed(show_tuple=True)
|
||||||
|
# from core.support import dbg;dbg()
|
||||||
if len(torrent_options) == 0:
|
if len(torrent_options) == 0:
|
||||||
from platformcode import elementum_download
|
from platformcode import elementum_download
|
||||||
install = elementum_download.download()
|
install = elementum_download.download()
|
||||||
@@ -1491,7 +1492,9 @@ def play_torrent(item, xlistitem, mediaurl):
|
|||||||
selection = 0
|
selection = 0
|
||||||
|
|
||||||
if selection >= 0:
|
if selection >= 0:
|
||||||
prevent_busy(item)
|
xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))
|
||||||
|
xbmc.sleep(200)
|
||||||
|
xbmc.Player().stop()
|
||||||
|
|
||||||
mediaurl = urllib.quote_plus(item.url)
|
mediaurl = urllib.quote_plus(item.url)
|
||||||
torr_client = torrent_options[selection][0]
|
torr_client = torrent_options[selection][0]
|
||||||
@@ -1505,14 +1508,15 @@ def play_torrent(item, xlistitem, mediaurl):
|
|||||||
if torr_client in ['elementum'] and item.downloadFilename:
|
if torr_client in ['elementum'] and item.downloadFilename:
|
||||||
torrent.elementum_download(item)
|
torrent.elementum_download(item)
|
||||||
else:
|
else:
|
||||||
time.sleep(3)
|
# time.sleep(3)
|
||||||
|
# xbmc.Player().play(torrent_options[selection][1] % mediaurl)
|
||||||
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
|
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
|
||||||
|
|
||||||
torrent.mark_auto_as_watched(item)
|
# torrent.mark_auto_as_watched(item)
|
||||||
|
|
||||||
if not item.globalsearch:
|
# if not item.globalsearch:
|
||||||
while is_playing() and not xbmc.Monitor().abortRequested():
|
# while is_playing() and not xbmc.Monitor().abortRequested():
|
||||||
time.sleep(3)
|
# time.sleep(3)
|
||||||
|
|
||||||
|
|
||||||
def resume_playback(played_time):
|
def resume_playback(played_time):
|
||||||
@@ -1823,7 +1827,3 @@ def prevent_busy(item):
|
|||||||
else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
|
else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
|
||||||
xbmc.sleep(200)
|
xbmc.sleep(200)
|
||||||
xbmc.Player().stop()
|
xbmc.Player().stop()
|
||||||
# xbmc.executebuiltin('Action(Stop)')
|
|
||||||
# xbmc.sleep(500)
|
|
||||||
# xbmc.Player().stop()
|
|
||||||
# xbmc.sleep(500)
|
|
||||||
Reference in New Issue
Block a user