- def openload_decode(self, txt):
- symbol_dict = {
- '(゚Д゚) [゚Θ゚]': '_',
- '(゚Д゚) [゚ω゚ノ]': 'a',
- '(゚Д゚) [゚Θ゚ノ]': 'b',
- '(゚Д゚) [\'c\']': 'c',
- '(゚Д゚) [゚ー゚ノ]': 'd',
- '(゚Д゚) [゚Д゚ノ]': 'e',
- '(゚Д゚) [1]': 'f',
- '(゚Д゚) [\'o\']': 'o',
- '(o゚ー゚o)': 'u',
- '(゚Д゚) [\'c\']': 'c',
- '((゚ー゚) + (o^_^o))': '7',
- '((o^_^o) +(o^_^o) +(c^_^o))': '6',
- '((゚ー゚) + (゚Θ゚))': '5',
- '(-~3)': '4',
- '(-~-~1)': '3',
- '(-~1)': '2',
- '(-~0)': '1',
- '((c^_^o)-(c^_^o))': '0',
- }
- delim = '(゚Д゚)[゚ε゚]+'
- end_token = '(゚Д゚)[゚o゚]'
- symbols = '|'.join(map(re.escape, symbol_dict.keys()))
- txt = re.sub('(%s)\+\s?' % symbols, lambda m: symbol_dict[m.group(1)], txt)
- ret = ''
- for aacode in re.findall(r'{0}\+\s?{1}(.*?){0}'.format(re.escape(end_token), re.escape(delim)), txt):
- for aachar in aacode.split(delim):
- if aachar.isdigit():
- ret += compat_chr(int(aachar, 8))
- else:
- m = re.match(r'^u([\da-f]{4})$', aachar)
- if m:
- ret += compat_chr(int(m.group(1), 16))
- else:
- self.report_warning("Cannot decode: %s" % aachar)
- return ret
+ @staticmethod
+ def _extract_urls(webpage):
+ return re.findall(
+ r'<iframe[^>]+src=["\']((?:https?://)?(?:openload\.(?:co|io)|oload\.tv)/embed/[a-zA-Z0-9-_]+)',
+ webpage)