Changeset 41179 for titan/mediathek


Ignore:
Timestamp:
Nov 16, 2017, 9:05:46 PM (2 years ago)
Author:
obi
Message:

streamago add file not found msg

File:
1 edited

Legend:

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

    r41176 r41179  
    4141                print video_link
    4242            else:
    43                 print 'No playable video found.'
     43                print 'errormsg=No playable video found.'
    4444
    4545    def get_media_url(self, host, media_id):
     
    5050
    5151        html = self.net.http_GET(web_url, headers=headers).content
    52        
     52#        print "html", html.encode('utf8')
     53
    5354        if html:
    54             encoded = re.search('''srces\.push\({type:"video/mp4",src:\w+\('([^']+)',(\d+)''', html)
    55             if encoded:
    56                 source = self.decode(encoded.group(1), int(encoded.group(2)))
    57                 if source:
    58                     source = "http:%s" % source if source.startswith("//") else source
    59                     source = source.split("/")
    60                     if not source[-1].isdigit():
    61                       source[-1] = re.sub('[^\d]', '', source[-1])
    62                     source = "/".join(source)
    63                     headers.update({'Referer': web_url})
    64 #                    return source + helpers.append_headers(headers)
    65                     print source + helpers.append_headers(headers)
     55            if re.search('>Sorry!<', html):
     56                print "errormsg=Sorry!\n%s" % (str(re.compile('<p class="lead">*(.+?)</p>').findall(html)[0]))
     57#                print 'errormsg=File was deleted.'
     58            else:
     59                encoded = re.search('''srces\.push\({type:"video/mp4",src:\w+\('([^']+)',(\d+)''', html)
     60                if encoded:
     61                    source = self.decode(encoded.group(1), int(encoded.group(2)))
     62                    if source:
     63                        source = "http:%s" % source if source.startswith("//") else source
     64                        source = source.split("/")
     65                        if not source[-1].isdigit():
     66                          source[-1] = re.sub('[^\d]', '', source[-1])
     67                        source = "/".join(source)
     68                        headers.update({'Referer': web_url})
     69#                        return source + helpers.append_headers(headers)
     70                        print source + helpers.append_headers(headers)
    6671       
    6772#        raise ResolverError("Unable to locate video")
    68        
     73                else:
     74                    print 'errormsg=Unable to locate encoded video'
     75        else:
     76            print 'errormsg=Error 404 Website not found !'
     77
     78#<h1 style="text-align: center !important;">Sorry!</h1>
     79#<p class="lead">We are unable to find the video you're looking for. There could be several reasons for this, for example it got removed by the owner.</p>
     80#</div>
     81#</div>
     82
    6983    def decode(self, encoded, code):
    7084        _0x59b81a = ""
Note: See TracChangeset for help on using the changeset viewer.