Beispiel #1
0
def play(uri):
    from xbmctorrent.player import TorrentPlayer
    uri = ensure_magnet(uri)
    if plugin.get_setting("magnet_boost", bool):
        plugin.log.info("Enabled magnet booster")
        uri = _boost_magnet(uri)
    TorrentPlayer().init(uri).loop()
def play(uri, pulsar):
    if not uri.startswith("http://") and not uri.startswith("https://") and not uri.startswith("magnet:"):
       with open(uri, 'rb') as file: 
           torrent_data = file.read()

       from xbmctorrent.magnet import generate_magnet
       from bencode import bdecode

       metadata = bdecode(torrent_data)
       uri = generate_magnet(metadata)

    if int(pulsar):
        from urllib import urlencode
        plugin.set_resolved_url("plugin://plugin.video.pulsar/play?%s" % urlencode({ "uri" : uri }))
    else:
        if uri.startswith("magnet:") and plugin.get_setting("magnet_boost", bool):
            plugin.log.info("Enabled magnet booster")
            uri = _boost_magnet(uri)

        from xbmctorrent.player import TorrentPlayer
        TorrentPlayer().init(uri).loop()
def play(uri, pulsar):
    if not uri.startswith("http://") and not uri.startswith(
            "https://") and not uri.startswith("magnet:"):
        with open(uri, 'rb') as file:
            torrent_data = file.read()

        from xbmctorrent.magnet import generate_magnet
        from bencode import bdecode

        metadata = bdecode(torrent_data)
        uri = generate_magnet(metadata)

    if int(pulsar):
        from urllib import urlencode
        plugin.set_resolved_url("plugin://plugin.video.pulsar/play?%s" %
                                urlencode({"uri": uri}))
    else:
        if uri.startswith("magnet:") and plugin.get_setting(
                "magnet_boost", bool):
            plugin.log.info("Enabled magnet booster")
            uri = _boost_magnet(uri)

        from xbmctorrent.player import TorrentPlayer
        TorrentPlayer().init(uri).loop()
Beispiel #4
0
def play(uri):
    from xbmctorrent.player import TorrentPlayer
    if uri.startswith("magnet:") and plugin.get_setting("magnet_boost", bool):
        plugin.log.info("Enabled magnet booster")
        uri = _boost_magnet(uri)
    TorrentPlayer().init(uri).loop()
Beispiel #5
0
def play(uri):
    from xbmctorrent.player import TorrentPlayer
    if uri.startswith("magnet:") and plugin.get_setting("magnet_boost", bool):
        plugin.log.info("Enabled magnet booster")
        uri = _boost_magnet(uri)
    TorrentPlayer().init(uri).loop()
Beispiel #6
0
def play(magnet):
    from xbmctorrent.player import TorrentPlayer
    if plugin.get_setting("magnet_boost", bool):
        plugin.log.info("Enabled magnet booster")
        magnet = _boost_magnet(magnet)
    TorrentPlayer().init(magnet).loop()
Beispiel #7
0
def play(magnet):
    from xbmctorrent.player import TorrentPlayer
    if plugin.get_setting("magnet_boost", bool):
        plugin.log.info("Enabled magnet booster")
        magnet = _boost_magnet(magnet)
    TorrentPlayer().init(magnet).loop()