Changeset 39076


Ignore:
Timestamp:
09/29/16 02:08:25 (8 years ago)
Author:
obi
Message:

tithek flashx add best source

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/mediathek/localhoster/flashx.py

    r39075 r39076  
    6262            except: pass
    6363
    64         stream = re.search('file:"([^"]*/high.*)",label', html).group(1)
    65         if stream:
    66             print stream
    67         else:
    68             stream = re.search('file:"([^"]*/normal.*)",label', html).group(1)
    69             if stream:
    70                 print stream
    71             else:
    72                 stream = re.search('file:"([^"]*/low.*)",label', html).group(1)
    73                 if stream:
    74                     print stream
    75                 else:
    76                     stream = re.search('file:"([^"]*)",label', html).group(1)
    77                     if stream:
    78                         print stream
     64        print self.get_best_source(html)
    7965
    8066    def get_url(self, host, media_id):
    8167        return 'http://www.flashx.tv/%s.html' % media_id
    82  
     68
     69
     70    def get_best_source(self, html):
     71        stream = re.search('file:"([^"]*/high.*)",label', html)
     72        if stream:
     73            return re.search('file:"([^"]*/high.*)",label', html).group(1)
     74        else:
     75            stream = re.search('file:"([^"]*/normal.*)",label', html)
     76            if stream:
     77                return re.search('file:"([^"]*/normal.*)",label', html).group(1)
     78            else:
     79                stream = re.search('file:"([^"]*/low.*)",label', html)
     80                if stream:
     81                    return re.search('file:"([^"]*/low.*)",label', html).group(1)
     82                else:
     83                    stream = re.search('file:"([^"]*)",label', html)
     84                    if stream:
     85                        return re.search('file:"([^"]*)",label', html).group(1)
     86                       
    8387sys.stdout = FlashxResolver()
Note: See TracChangeset for help on using the changeset viewer.