Esempio n. 1
0
def copy_metainfo_to_input(metainfo, input):
    keys = tdefdictdefaults.keys()
    # Arno: For magnet link support
    keys.append("initial peers")
    for key in keys:
        if key in metainfo:
            input[key] = metainfo[key]

    infokeys = ['name', 'piece length']
    for key in infokeys:
        if key in metainfo['info']:
            input[key] = metainfo['info'][key]

    # Note: don't know inpath, set to outpath
    if 'length' in metainfo['info']:
        outpath = metainfo['info']['name']
        length = metainfo['info']['length']
        d = {'inpath': outpath, 'outpath': outpath, 'length': length}
        input['files'].append(d)
    else:  # multi-file torrent
        files = metainfo['info']['files']
        for file in files:
            outpath = pathlist2filename(file['path'])
            length = file['length']
            d = {'inpath': outpath, 'outpath': outpath, 'length': length}
            input['files'].append(d)

    # Diego : we want web seeding
    if 'url-list' in metainfo:
        input['url-list'] = metainfo['url-list']

    if 'httpseeds' in metainfo:
        input['httpseeds'] = metainfo['httpseeds']
Esempio n. 2
0
def copy_metainfo_to_input(metainfo, input):
    keys = tdefdictdefaults.keys()
    # Arno: For magnet link support
    keys.append("initial peers")
    for key in keys:
        if key in metainfo:
            input[key] = metainfo[key]

    infokeys = ['name', 'piece length']
    for key in infokeys:
        if key in metainfo['info']:
            input[key] = metainfo['info'][key]

    # Note: don't know inpath, set to outpath
    if 'length' in metainfo['info']:
        outpath = metainfo['info']['name']
        length = metainfo['info']['length']
        d = {'inpath': outpath, 'outpath': outpath, 'length': length}
        input['files'].append(d)
    else:  # multi-file torrent
        files = metainfo['info']['files']
        for file in files:
            outpath = pathlist2filename(file['path'])
            length = file['length']
            d = {'inpath': outpath, 'outpath': outpath, 'length': length}
            input['files'].append(d)

    # Diego : we want web seeding
    if 'url-list' in metainfo:
        input['url-list'] = metainfo['url-list']

    if 'httpseeds' in metainfo:
        input['httpseeds'] = metainfo['httpseeds']
Esempio n. 3
0
def copy_metainfo_to_input(metainfo, input):

    for key in tdefdictdefaults.keys():
        if key in metainfo:
            input[key] = metainfo[key]

    infokeys = ['name', 'piece length', 'live']
    for key in infokeys:
        if key in metainfo['info']:
            input[key] = metainfo['info'][key]

    # Note: don't know inpath, set to outpath
    if 'length' in metainfo['info']:
        outpath = metainfo['info']['name']
        if 'playtime' in metainfo['info']:
            playtime = metainfo['info']['playtime']
        else:
            playtime = None
        length = metainfo['info']['length']
        d = {
            'inpath': outpath,
            'outpath': outpath,
            'playtime': playtime,
            'length': length
        }
        input['files'].append(d)
    else:  # multi-file torrent
        files = metainfo['info']['files']
        for file in files:
            outpath = pathlist2filename(file['path'])
            if 'playtime' in file:
                playtime = file['playtime']
            else:
                playtime = None
            length = file['length']
            d = {
                'inpath': outpath,
                'outpath': outpath,
                'playtime': playtime,
                'length': length
            }
            input['files'].append(d)

    if 'azureus_properties' in metainfo:
        azprop = metainfo['azureus_properties']
        if 'Content' in azprop:
            content = metainfo['azureus_properties']['Content']
            if 'Thumbnail' in content:
                input['thumb'] = content['Thumbnail']

    if 'live' in metainfo['info']:
        input['live'] = metainfo['info']['live']
Esempio n. 4
0
def copy_metainfo_to_input(metainfo,input):
    
    for key in tdefdictdefaults.keys():
        if key in metainfo:
            input[key] = metainfo[key]
            
    infokeys = ['name','piece length','live','url-compat']
    for key in infokeys:
        if key in metainfo['info']:
            input[key] = metainfo['info'][key]
        
    # Note: don't know inpath, set to outpath
    if 'length' in metainfo['info']:
        outpath = metainfo['info']['name']
        if 'playtime' in metainfo['info']:
            playtime = metainfo['info']['playtime']
        else:
            playtime = None
        length = metainfo['info']['length'] 
        d = {'inpath':outpath,'outpath':outpath,'playtime':playtime,'length':length}
        input['files'].append(d)
    else: # multi-file torrent
        files = metainfo['info']['files']
        for file in files:
            outpath = pathlist2filename(file['path'])
            if 'playtime' in file:
                playtime = file['playtime']
            else:
                playtime = None
            length = file['length'] 
            d = {'inpath':outpath,'outpath':outpath,'playtime':playtime,'length':length}
            input['files'].append(d)
    
    if 'azureus_properties' in metainfo:
        azprop = metainfo['azureus_properties']
        if 'Content' in azprop:
            content = metainfo['azureus_properties']['Content']
            if 'Thumbnail' in content:
                input['thumb'] = content['Thumbnail']
      
    if 'live' in metainfo['info']:
        input['live'] = metainfo['info']['live'] 

    if 'cs_keys' in metainfo['info']:
        input['cs_keys'] = metainfo['info']['cs_keys']

    if 'url-compat' in metainfo['info']:
        input['url-compat'] = metainfo['info']['url-compat'] 
Esempio n. 5
0
def copy_metainfo_to_input(metainfo,input):
    
    keys = tdefdictdefaults.keys()
    # Arno: For magnet link support
    keys.append("initial peers")
    for key in keys:
        if key in metainfo:
            input[key] = metainfo[key]
            
    infokeys = ['name','piece length','live','url-compat']
    for key in infokeys:
        if key in metainfo['info']:
            input[key] = metainfo['info'][key]
        
    # Note: don't know inpath, set to outpath
    if 'length' in metainfo['info']:
        outpath = metainfo['info']['name']
        if 'playtime' in metainfo['info']:
            playtime = metainfo['info']['playtime']
        else:
            playtime = None
        length = metainfo['info']['length'] 
        d = {'inpath':outpath,'outpath':outpath,'playtime':playtime,'length':length}
        input['files'].append(d)
    else: # multi-file torrent
        files = metainfo['info']['files']
        for file in files:
            outpath = pathlist2filename(file['path'])
            if 'playtime' in file:
                playtime = file['playtime']
            else:
                playtime = None
            length = file['length'] 
            d = {'inpath':outpath,'outpath':outpath,'playtime':playtime,'length':length}
            input['files'].append(d)
    
    if 'azureus_properties' in metainfo:
        azprop = metainfo['azureus_properties']
        if 'Content' in azprop:
            content = metainfo['azureus_properties']['Content']
            if 'Thumbnail' in content:
                input['thumb'] = content['Thumbnail']
      
    if 'live' in metainfo['info']:
        input['live'] = metainfo['info']['live'] 

    if 'cs_keys' in metainfo['info']:
        input['cs_keys'] = metainfo['info']['cs_keys']

    if 'url-compat' in metainfo['info']:
        input['url-compat'] = metainfo['info']['url-compat'] 

    if 'ogg-headers' in metainfo:
        input['ogg-headers'] = metainfo['ogg-headers']

    if 'ns-metadata' in metainfo['info']:
        input['ns-metadata'] = metainfo['info']['ns-metadata']

    # Diego : we want web seeding
    if 'url-list' in metainfo:
        input['url-list'] = metainfo['url-list'] 

    if 'httpseeds' in metainfo:
        input['httpseeds'] = metainfo['httpseeds']
Esempio n. 6
0
def copy_metainfo_to_input(metainfo, input):

    keys = tdefdictdefaults.keys()
    # Arno: For magnet link support
    keys.append("initial peers")
    for key in keys:
        if key in metainfo:
            input[key] = metainfo[key]

    infokeys = ['name', 'piece length', 'live', 'url-compat']
    for key in infokeys:
        if key in metainfo['info']:
            input[key] = metainfo['info'][key]

    # Note: don't know inpath, set to outpath
    if 'length' in metainfo['info']:
        outpath = metainfo['info']['name']
        if 'playtime' in metainfo['info']:
            playtime = metainfo['info']['playtime']
        else:
            playtime = None
        length = metainfo['info']['length']
        d = {'inpath': outpath, 'outpath': outpath, 'playtime':playtime, 'length':length}
        input['files'].append(d)
    else:  # multi-file torrent
        files = metainfo['info']['files']
        for file in files:
            outpath = pathlist2filename(file['path'])
            if 'playtime' in file:
                playtime = file['playtime']
            else:
                playtime = None
            length = file['length']
            d = {'inpath': outpath, 'outpath': outpath, 'playtime':playtime, 'length':length}
            input['files'].append(d)

    if 'azureus_properties' in metainfo:
        azprop = metainfo['azureus_properties']
        if 'Content' in azprop:
            content = metainfo['azureus_properties']['Content']
            if 'Thumbnail' in content:
                input['thumb'] = content['Thumbnail']

    if 'live' in metainfo['info']:
        input['live'] = metainfo['info']['live']

    if 'cs_keys' in metainfo['info']:
        input['cs_keys'] = metainfo['info']['cs_keys']

    if 'url-compat' in metainfo['info']:
        input['url-compat'] = metainfo['info']['url-compat']

    if 'ogg-headers' in metainfo:
        input['ogg-headers'] = metainfo['ogg-headers']

    if 'ns-metadata' in metainfo['info']:
        input['ns-metadata'] = metainfo['info']['ns-metadata']

    # Diego : we want web seeding
    if 'url-list' in metainfo:
        input['url-list'] = metainfo['url-list']

    if 'httpseeds' in metainfo:
        input['httpseeds'] = metainfo['httpseeds']
Esempio n. 7
0
def copy_metainfo_to_input(metainfo, input):

    keys = tdefdictdefaults.keys()
    # Arno: For magnet link support
    keys.append("initial peers")
    for key in keys:
        if key in metainfo:
            input[key] = metainfo[key]

    infokeys = ["name", "piece length", "live", "url-compat"]
    for key in infokeys:
        if key in metainfo["info"]:
            input[key] = metainfo["info"][key]

    # Note: don't know inpath, set to outpath
    if "length" in metainfo["info"]:
        outpath = metainfo["info"]["name"]
        if "playtime" in metainfo["info"]:
            playtime = metainfo["info"]["playtime"]
        else:
            playtime = None
        length = metainfo["info"]["length"]
        d = {"inpath": outpath, "outpath": outpath, "playtime": playtime, "length": length}
        input["files"].append(d)
    else:  # multi-file torrent
        files = metainfo["info"]["files"]
        for file in files:
            outpath = pathlist2filename(file["path"])
            if "playtime" in file:
                playtime = file["playtime"]
            else:
                playtime = None
            length = file["length"]
            d = {"inpath": outpath, "outpath": outpath, "playtime": playtime, "length": length}
            input["files"].append(d)

    if "azureus_properties" in metainfo:
        azprop = metainfo["azureus_properties"]
        if "Content" in azprop:
            content = metainfo["azureus_properties"]["Content"]
            if "Thumbnail" in content:
                input["thumb"] = content["Thumbnail"]

    if "live" in metainfo["info"]:
        input["live"] = metainfo["info"]["live"]

    if "cs_keys" in metainfo["info"]:
        input["cs_keys"] = metainfo["info"]["cs_keys"]

    if "url-compat" in metainfo["info"]:
        input["url-compat"] = metainfo["info"]["url-compat"]

    if "ogg-headers" in metainfo:
        input["ogg-headers"] = metainfo["ogg-headers"]

    if "ns-metadata" in metainfo["info"]:
        input["ns-metadata"] = metainfo["info"]["ns-metadata"]

    # Diego : we want web seeding
    if "url-list" in metainfo:
        input["url-list"] = metainfo["url-list"]

    if "httpseeds" in metainfo:
        input["httpseeds"] = metainfo["httpseeds"]