def __init__(self, storageDirectory='', torrentFile='', torrentFilesDirectory='torrents'): self.storageDirectory = storageDirectory self.torrentFilesPath = os.path.join(self.storageDirectory, torrentFilesDirectory) + os.sep if not is_writable(self.storageDirectory): xbmcgui.Dialog().ok( Localization.localize('Torrenter v2'), Localization.localize( 'Your storage path is not writable or not local! Please change it in settings!' ), Localization.localize(self.storageDirectory)) sys.exit(1) try: from python_libtorrent import get_libtorrent libtorrent = get_libtorrent() log('Imported libtorrent v%s from python_libtorrent' % (libtorrent.version)) module = True except Exception, e: module = False log('Error importing python_libtorrent Exception: %s' % (str(e))) import libtorrent
def __init__(self, storageDirectory='', torrentFile='', torrentFilesDirectory='torrents'): self.storageDirectory = storageDirectory self.torrentFilesPath = os.path.join(self.storageDirectory, torrentFilesDirectory) + os.sep if not is_writable(self.storageDirectory): xbmcgui.Dialog().ok(Localization.localize('Torrenter v2'), Localization.localize('Your storage path is not writable or not local! Please change it in settings!'), Localization.localize(self.storageDirectory)) sys.exit(1) try: from python_libtorrent import get_libtorrent libtorrent=get_libtorrent() log('Imported libtorrent v%s from python_libtorrent' %(libtorrent.version)) module=True except Exception, e: module=False log('Error importing python_libtorrent Exception: %s' %( str(e))) import libtorrent
# You should have received a copy of the GNU General Public License # along with pelisalacarta 4. If not, see <http://www.gnu.org/licenses/>. # ------------------------------------------------------------ # MCT - Mini Cliente Torrent para pelisalacarta #------------------------------------------------------------ import os import re import shutil import tempfile import urllib import urllib2 try: from python_libtorrent import get_libtorrent lt = get_libtorrent() except Exception, e: import libtorrent as lt import xbmc import xbmcgui from core import config from core import scrapertools from core import filetools def play(url, xlistitem, is_view=None, subtitle=""): # -- Necesario para algunas webs ---------------------------- if not url.endswith(".torrent") and not url.startswith("magnet"):
# it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # streamondemand 5 is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with streamondemand 5. If not, see <http://www.gnu.org/licenses/>. # ------------------------------------------------------------ try: from python_libtorrent import get_libtorrent, get_platform lt = get_libtorrent() except Exception, e: import libtorrent as lt import sys import os import random import urllib from monitor import Monitor from dispatcher import Dispatcher from file import File from resume_data import ResumeData from server import Server from handler import Handler from cache import Cache import time