vdeku / anarchintosh-projects

Automatically exported from code.google.com/p/anarchintosh-projects
0 stars 0 forks source link

Script Error - list.index(x) #195

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go to TV Shows > A-Z > American Idol > Season 13 > Episode 21
2. you will get a script error 
3.

What is the expected output? What do you see instead?
To view a list of sources for a Movie/Video

What version of the product are you using? On what operating system?
1.2.1 Windows 7 64bit

Please provide any additional information below.
I was able to patch the code to fix myself. The determine_source function in 
default.py creates a list of possible sources in 1.2.1 megafiles.se does not 
exist. To fix this and any other possible sources from causing this error I 
patched the function listed below with a dummy list item that is selected on 
fail. The sources do not work but I can now access the other sources and should 
not see this error again.

def determine_source(url):
# Added OT for all other sources
    host_list = [('', 'OT', '', ''),
                ('2shared.com', '2S', handle_file('shared2pic',''), 'SHARED2_HANDLER'),
                ('180upload.com', '180', handle_file('180pic',''), 'resolve_180upload'),
                ('vidhog.com', 'VH', handle_file('vihogpic',''), 'resolve_vidhog'),
                ('sharebees.com', 'SB', handle_file('sharebeespic',''), 'resolve_sharebees'),
                ('movreel.com', 'MR', handle_file('movreelpic',''), 'resolve_movreel'),
                ('billionuploads.com', 'BU',  handle_file('billionpic',''), 'resolve_billionuploads'),
                ('epicshare.net', 'ES',  handle_file('epicpic',''), 'resolve_epicshare'),
                ('megarelease.org', 'MG',  handle_file('megarpic',''), 'resolve_megarelease'),
                ('lemuploads.com', 'LU',  handle_file('lempic',''), 'resolve_lemupload'),
                ('hugefiles.net', 'HF',  handle_file('hugepic',''), 'resolve_hugefiles'),
                ('entroupload.com', 'EU',  handle_file('entropic',''), 'resolve_entroupload'),
                ('donevideo.com', 'DV', '', 'resolve_donevideo')
                ]

    hoster = re.search('https?://[www\.]*([^/]+)/', url)

    if hoster:
        source_info = {}
        domain = hoster.group(1)
        try:
            host_index = [y[0] for y in host_list].index(domain)
        except:
            host_index = 0

        return host_list[host_index]

Original issue reported on code.google.com by MPrice1...@gmail.com on 22 Mar 2014 at 12:12