Example #1
0
def get_orderby_class_by_name(url, ontent,
                              sort_method_name):  # category,country,sort #

    match = hsk.regex_search(
        '<select class="orderby" name="' + sort_method_name +
        '">[\s\S]*?<\/select>', content)
    if match:

        sort_list = []
        category = ''
        country = ''
        sort = ''
        for value, title in hsk.regex_findall(
                '<option value="(.*?)"[\s\S]*?>(.*?)<\/option>',
                match.group(0)):

            if sort_method_name == 'category': category = value
            elif sort_method_name == 'country': country = value
            elif sort_method_name == 'sort': sort = value

            if value:
                sort_list.append({
                    'sort_url':
                    url + '?category=' + category + '&country=' + country +
                    '&sort=' + sort + '&key=&sort_type=desc',
                    'sort_title':
                    title
                })
            if (sort_method_name == 'category'
                    or sort_method_name == 'country'):
                sort_list.sort(key=lambda i: i.get('sort_title'),
                               reverse=False)
        return sort_list
Example #2
0
def get_server_video_regex(content):
    match = hsk.regex_search('var sources = (\[.*?\]);', content)
    if match:
        return hsk.regex_findall('"file":"(.+?)"[\s\S]*?"label":"(.+?)"',
                                 match.group(1))
    else:
        return []
Example #3
0
def get_video_list(content):
    return hsk.regex_findall(
        '<li>\s<div class="box-product clearfix"[\s\S]+?href="(.+?)"[\s\S]+?data-src="(.+?)"[\s\S]+?title="(.+?)">\s(.+?)\s<\/a>',
        content)
Example #4
0
def get_server_regex_playlist(content):
    return hsk.regex_findall('RESOLUTION=\d+x([\d]+)([^#]+)', content)
Example #5
0
def get_episodes(content):
    return hsk.regex_findall(
        '<a (?:class="current"|class="watched"|class="new")[\s\S]*?href="(.+?)" data-episode-id="(.+?)" title="(.+?)">',
        content)