# Path: mybs.py
# def SelStr(sel, data):
#     mp = MyHtmlParser(tidy=False)
#     mp.feed(data)
#     return mp.select(sel)
# 
# Path: comm.py
#     def echo(*args):
#     def U(dat):
#     def echo(*args):
#     def U(dat):
# def debug(*args):
# def norm_url(url):
#     def __init__(self, url, referer):
#     def __init__(self, proxy=None):
#     def get_html(self, url, raw=False, postdata=None):
#     def get_hutf(self, *param, **dd):
#     def chrome_hutf(self, url):
#     def phantom_hutf(self, url, timeout=300, refer=None, postdata=None):
#     def last_m3u8(self, src):
#     def try_m3u8(self, src):
#     def _get_m3u8_urls(self, src, data):
#     def get_outfn(self, title, ext, unum=0):
#     def align_title_num(self, t):
#     def get_total_size(self, urllist):
#     def use_dwm_merge(self, urls, title, ext, clean=True):
#     def download_urls_you_get(self, title, ext, urls, totalsize):
#     def get_real_url(self, bu, rt, uri):
#     def try_key(self, bu, rt, dn, line):
#     def wget_m3u8(self, title, url):
#     def download_m3u8(self, title, url):
#     def avconv_m3u8(self, title, ext, url):
#     def wget_urls(self, title, ext, urls, tsize):
#     def wget_one_url(self, outfn, url, unum, totalsize=0):
#     def get_one(self, url, t=UTITLE, n=False):
#     def try_playlist(self, ispl, url):
#     def get_playlist(self, page_url):
#     def clean_up(self):
#     def test(self, args):
#     def can_handle_it(cls, url):
# def get_kind_size(u, cookie=""):
# def get_total_size_st(urllist):
# def get_total_size_mt(urllist, tn=10):
#     def worker():
# def search_first(text, *patterns):
# def match1(text, *patterns):
# def c2n(cs):
# def norm_title(title):
# def start(kls):
# def run(k, args):
#     class ConnectionResetError(Exception):
# class UO(object):
# class DWM(object):
# USER_AGENT = 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36'
# USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36'
# DEBUG = False
# UTITLE = "UnknownTitle"
#     DEBUG = args.debug
#         DEBUG = True


import os
import re
import sys
from mybs import SelStr
from comm import DWM, match1, echo, start, debug, py3, get_kind_size
            from letv import LETV
# -*- coding: utf8 -*-




class TTWanDa(DWM):     # http://www.ttwanda.com/
    handle_list = ['\.ttwanda\.com/films/', '\.ttwanda\.com/tv/']

    def query_info(self, url):
        #url = 'http://www.ttwanda.com/films/us/1693.html?xf'
        hutf = self.get_hutf(url)
        if '?' not in url:
            a = SelStr('section.p5 div a', hutf)[0]['href']
            url = url + a
            hutf = self.get_hutf(url)
        title = SelStr("div.video-content article p strong", hutf)[0].text
        r = "《(.+)》"

# Path: mybs.py
# def SelStr(sel, data):
#     mp = MyHtmlParser(tidy=False)
#     mp.feed(data)
#     return mp.select(sel)
# 
# Path: comm.py
#     def echo(*args):
#     def U(dat):
#     def echo(*args):
#     def U(dat):
# def debug(*args):
# def norm_url(url):
#     def __init__(self, url, referer):
#     def __init__(self, proxy=None):
#     def get_html(self, url, raw=False, postdata=None):
#     def get_hutf(self, *param, **dd):
#     def chrome_hutf(self, url):
#     def phantom_hutf(self, url, timeout=300, refer=None, postdata=None):
#     def last_m3u8(self, src):
#     def try_m3u8(self, src):
#     def _get_m3u8_urls(self, src, data):
#     def get_outfn(self, title, ext, unum=0):
#     def align_title_num(self, t):
#     def get_total_size(self, urllist):
#     def use_dwm_merge(self, urls, title, ext, clean=True):
#     def download_urls_you_get(self, title, ext, urls, totalsize):
#     def get_real_url(self, bu, rt, uri):
#     def try_key(self, bu, rt, dn, line):
#     def wget_m3u8(self, title, url):
#     def download_m3u8(self, title, url):
#     def avconv_m3u8(self, title, ext, url):
#     def wget_urls(self, title, ext, urls, tsize):
#     def wget_one_url(self, outfn, url, unum, totalsize=0):
#     def get_one(self, url, t=UTITLE, n=False):
#     def try_playlist(self, ispl, url):
#     def get_playlist(self, page_url):
#     def clean_up(self):
#     def test(self, args):
#     def can_handle_it(cls, url):
# def get_kind_size(u, cookie=""):
# def get_total_size_st(urllist):
# def get_total_size_mt(urllist, tn=10):
#     def worker():
# def search_first(text, *patterns):
# def match1(text, *patterns):
# def c2n(cs):
# def norm_title(title):
# def start(kls):
# def run(k, args):
#     class ConnectionResetError(Exception):
# class UO(object):
# class DWM(object):
# USER_AGENT = 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36'
# USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36'
# DEBUG = False
# UTITLE = "UnknownTitle"
#     DEBUG = args.debug
#         DEBUG = True


# Path: ttwanda.py
import os
import re
import sys
from mybs import SelStr
from comm import DWM, match1, echo, start, debug, py3, get_kind_size
            from letv import LETV

# -*- coding: utf8 -*-




class TTWanDa(DWM):     # http://www.ttwanda.com/
    handle_list = ['\.ttwanda\.com/films/', '\.ttwanda\.com/tv/']

    def query_info(self, url):
        #url = 'http://www.ttwanda.com/films/us/1693.html?xf'
        hutf = self.get_hutf(url)
        if '?' not in url:
            a = SelStr('section.p5 div a', hutf)[0]['href']
            url = url + a
            hutf = self.get_hutf(url)
        title = SelStr("div.video-content article p strong", hutf)[0].text
        r = "《(.+)》"

        if not py3: