コード例 #1
0
    def getSerialsListByLetter(self, baseUrl, cat, letter):
        letter = letter.replace(' ', '')
        printDBG("getSerialsListByLetter start letter=%s" % letter)
        sts, data = self.cm.getPage(baseUrl)
        if False == sts:
            printDBG("getSerialsListByLetter problem with getPage[%s]" %
                     baseUrl)
            return

        sts, data = CParsingHelper.getDataBeetwenMarkers(
            data, 'id="letter_%s">' % letter, '</ul>', False)
        if False == sts:
            printDBG("getSerialsListByLetter problem no data beetween markers")
            return

        data = re.compile(
            '<a href="([^"]+?)" class="pl-corners">(.+?)</a>').findall(data)
        if len(data) > 0:
            for i in range(len(data)):
                title = remove_html_markup(data[i][1])
                url = self.MAINURL + data[i][0].strip()
                params = {
                    'name': 'category',
                    'category': cat,
                    'title': title,
                    'url': url
                }
                self.addDir(params)
コード例 #2
0
    def listCategories(self, url, cat):
        printDBG("listCategories for url[%s] cat[%s]" % (url, cat))
        # add all item
        params = {'category': cat, 'title': '--Wszystkie--', 'cat_id': ''}
        self.addDir(params)

        sts, data = self.cm.getPage(url)
        if not sts: return
        sts, data = CParsingHelper.getDataBeetwenMarkers(
            data, "<div class='window_title'>", "<div class='footer'>")
        if not sts: return False
        data = data.split("<div class='list_title'>")
        if len(data) > 1:
            del data[0]
            for item in data:
                # cat_id: match.group(2) & title: match.group(1) & img: self.MAINURL + match.group(3)
                match = re.search(
                    "<b>([^<]+?)</b></a></div><a href='[^']*?category=([0-9]+?)'><img[^>]*?src='([^']+?)'",
                    item)
                if not match: continue
                # plot
                printDBG('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: [%s]' %
                         match.group(2))
                plot = CParsingHelper.removeDoubles(
                    remove_html_markup(item, ' ').replace(match.group(1), ''),
                    ' ')
                params = {
                    'category': cat,
                    'title': match.group(1),
                    'cat_id': match.group(2),
                    'icon': self.MAINURL + "/" + match.group(3),
                    'plot': plot
                }
                self.addDir(params)
コード例 #3
0
    def listVideos(self, baseUrl, cat, cat_id, sort, page, search_pattern=''):
        url = baseUrl % (cat_id, sort, page)
        printDBG("listVideos for url[%s]" % url)

        sts, data = self.cm.getPage(url)
        if not sts: return

        nextPage = False
        if -1 < data.find("class='black'>&raquo;</a>"):
            nextPage = True

        sts, data = CParsingHelper.getDataBeetwenMarkers(
            data, "<div class='window_title'>", "<div class='footer'>")
        if not sts: return False
        data = data.split("<div class='list' style='width: 173px;'>")
        if len(data) > 1:
            del data[0]
            for item in data:
                # vid_hash & img
                match = re.search(
                    "href='([0-9a-fA-F]{32})'[^>]*?><img[^>]*?src='([^']+?)'",
                    item)
                if not match: continue
                vid_hash = match.group(1)
                img = self.MAINURL + "/" + match.group(2)
                if not match: continue
                # title
                match = re.search(
                    "<div class='list_title'><a href='%s'>([^<]+?)</a></div>" %
                    vid_hash, item)
                if not match: continue
                title = match.group(1)
                # plot
                plot = CParsingHelper.removeDoubles(
                    remove_html_markup(item, ' ').replace(title, ''), ' ')

                params = {
                    'title': title,
                    'url': self.MAINURL + "/" + vid_hash,
                    'icon': img,
                    'plot': plot
                }
                if 'Rozmiar:' in item:
                    continue
                else:
                    self.playVideo(params)

        if nextPage:
            params = {
                'title': "Następna strona",
                'category': cat,
                'cat_id': cat_id,
                'sort': sort,
                'page': str(int(page) + 1),
                'search_pattern': search_pattern
            }
            self.addDir(params)
コード例 #4
0
    def getSearchResult(self, baseUrl, cat, page):
        printDBG("getSearchResult for url[%s] page[%s]" % (baseUrl, page))

        if 1 < int(page) != '1': url = baseUrl + page
        else: url = baseUrl
        sts, data = self.cm.getPage(url)
        if not sts: return

        nextPage = False
        if -1 < data.find("class='pagination_next'"):
            nextPage = True

        sts, data = self.getDataBeetwenMarkers(data,
                                               '<td valign="top">',
                                               '<div class="menu_dol">',
                                               withMarkers=False)
        if not sts: return

        data = data.split('<td valign="top">')
        for item in data:
            # url & title
            match = re.search(
                '<div class="video_title">[^<]*?<a href="([^"]+?)">([^<]+?)</a>',
                item)
            if match:
                url = match.group(1)
                title = match.group(2)
            else:
                continue
            # img
            match = re.search('src="([^"]+?)"', item)
            if match: img = match.group(1)
            else: img = ''
            # plot
            match = re.search('<div class="video_details">(.+?)</td>', item,
                              re.DOTALL)
            if match:
                plot = remove_html_markup(
                    match.group(1))  #.replace("</div>", " ")
            else:
                plot = ''

            params = {'title': title, 'url': url, 'icon': img, 'plot': plot}
            if 'Rozmiar:' in item:
                continue
            else:
                self.playVideo(params)

        if nextPage:
            params = {
                'title': "Następna strona",
                'url': baseUrl,
                'category': cat,
                'page': str(int(page) + 1)
            }
            self.addDir(params)
コード例 #5
0
    def listVideos(self, baseUrl, cat, page):
        printDBG("listVideos for url[%s] page[%s]" % (baseUrl, page))

        if 1 < int(page) != '1': url = baseUrl + page
        else: url = baseUrl
        sts, data = self.cm.getPage(url)
        if not sts: return

        nextPage = False
        if -1 < data.find("class='pagination_next'"):
            nextPage = True

        sts, data = self.getDataBeetwenMarkers(data,
                                               '<td class="video">',
                                               '</table>',
                                               withMarkers=False)
        if not sts: return

        data = data.split('<td class="video">')
        for item in data:
            # url & title
            match = re.search(
                'class="video_title"><a href="([^"]+?)">([^<]+?)</a>', item)
            if match:
                url = match.group(1)
                title = match.group(2)
            else:
                continue
            # img
            match = re.search('src="([^"]+?)"', item)
            if match: img = match.group(1)
            else: img = ''
            # plot
            match = re.search(
                '<p style="margin:5px;" class="video_details">(.+?)</p>', item,
                re.DOTALL)
            if match: plot = remove_html_markup(match.group(1))
            else: plot = ''

            params = {'title': title, 'url': url, 'icon': img, 'plot': plot}
            self.playVideo(params)

        if nextPage:
            params = {
                'title': "Następna strona",
                'url': baseUrl,
                'category': cat,
                'page': str(int(page) + 1)
            }
            self.addDir(params)
コード例 #6
0
    def getSerialsListByLetter(self, baseUrl, cat, letter):
        letter = letter.replace(' ', '')
        printDBG("getSerialsListByLetter start letter=%s" % letter)
        sts, data = self.cm.getPage( baseUrl )
        if False == sts:
            printDBG("getSerialsListByLetter problem with getPage[%s]" % baseUrl)
            return
            
        sts, data = CParsingHelper.getDataBeetwenMarkers(data, 'id="letter_%s">' % letter, '</ul>', False)
        if False == sts:
            printDBG("getSerialsListByLetter problem no data beetween markers")
            return

        data = re.compile('<a href="([^"]+?)" class="pl-corners">(.+?)</a>').findall(data)
        if len(data) > 0:
            for i in range(len(data)):
                title = remove_html_markup(data[i][1])
                url = self.MAINURL + data[i][0].strip() 
                params = {'name':'category', 'category':cat, 'title':title, 'url':url}
                self.addDir(params)
コード例 #7
0
    def getSearchResult(self, baseUrl, cat, page):
        printDBG("getSearchResult for url[%s] page[%s]" % (baseUrl, page))
        
        if 1 < int(page) != '1': url = baseUrl + page
        else: url = baseUrl
        sts, data = self.cm.getPage(url)
        if not sts: return
        
        nextPage = False
        if -1 < data.find("class='pagination_next'"):
            nextPage = True

        sts, data = self.getDataBeetwenMarkers(data, '<td valign="top">', '<div class="menu_dol">', withMarkers = False)
        if not sts: return
      
        data = data.split('<td valign="top">')
        for item in data:
            # url & title
            match = re.search('<div class="video_title">[^<]*?<a href="([^"]+?)">([^<]+?)</a>', item)
            if match: 
                url = match.group(1)
                title = match.group(2)
            else: continue
            # img
            match = re.search('src="([^"]+?)"', item)
            if match: img = match.group(1)
            else: img = ''
            # plot
            match = re.search('<div class="video_details">(.+?)</td>', item, re.DOTALL)
            if match: plot = remove_html_markup(match.group(1)) #.replace("</div>", " ")
            else: plot = ''
            
            params = { 'title': title, 'url': url, 'icon': img, 'plot': plot}
            if 'Rozmiar:' in item:
                continue
            else:
                self.playVideo(params)
            
        if nextPage:
            params = {'title': "Następna strona", 'url': baseUrl, 'category': cat, 'page':str(int(page)+1)}
            self.addDir(params)
コード例 #8
0
    def listCategories(self, url, cat):
        printDBG("listCategories for url[%s] cat[%s]" % (url, cat))
        # add all item
        params = {'category': cat, 'title': '--Wszystkie--' , 'cat_id': ''}
        self.addDir(params)

        sts, data = self.cm.getPage(url)
        if not sts: return
        sts, data = CParsingHelper.getDataBeetwenMarkers(data, "<div class='window_title'>", "<div class='footer'>")
        if not sts: return False
        data = data.split("<div class='list_title'>")
        if len(data) > 1:
            del data[0]
            for item in data:
                # cat_id: match.group(2) & title: match.group(1) & img: self.MAINURL + match.group(3)
                match = re.search("<b>([^<]+?)</b></a></div><a href='[^']*?category=([0-9]+?)'><img[^>]*?src='([^']+?)'", item)
                if not match: continue
                # plot
                printDBG('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: [%s]' % match.group(2))
                plot = CParsingHelper.removeDoubles(remove_html_markup(item, ' ').replace(match.group(1), ''), ' ')
                params = {'category': cat, 'title': match.group(1) , 'cat_id': match.group(2) , 'icon': self.MAINURL + "/" + match.group(3), 'plot':plot}
                self.addDir(params)
コード例 #9
0
    def listVideos(self, baseUrl, cat, cat_id, sort, page, search_pattern = ''):
        url = baseUrl % (cat_id, sort, page)
        printDBG("listVideos for url[%s]" % url)

        sts, data = self.cm.getPage(url)
        if not sts: return
        
        nextPage = False
        if -1 < data.find("class='black'>&raquo;</a>"):
            nextPage = True

        sts, data = CParsingHelper.getDataBeetwenMarkers(data, "<div class='window_title'>", "<div class='footer'>")
        if not sts: return False
        data = data.split("<div class='list' style='width: 173px;'>")
        if len(data) > 1:
            del data[0]
            for item in data:
                # vid_hash & img
                match = re.search("href='([0-9a-fA-F]{32})'[^>]*?><img[^>]*?src='([^']+?)'", item)
                if not match: continue
                vid_hash = match.group(1)
                img = self.MAINURL + "/" + match.group(2)
                if not match: continue
                # title
                match = re.search("<div class='list_title'><a href='%s'>([^<]+?)</a></div>" % vid_hash, item)
                if not match: continue
                title = match.group(1)
                # plot
                plot = CParsingHelper.removeDoubles(remove_html_markup(item, ' ').replace(title, ''), ' ')
            
                params = { 'title': title, 'url': self.MAINURL + "/" +vid_hash, 'icon': img, 'plot': plot}
                if 'Rozmiar:' in item:
                    continue
                else:
                    self.playVideo(params)
            
        if nextPage:
            params = {'title': "Następna strona", 'category': cat, 'cat_id':cat_id, 'sort':sort, 'page':str(int(page)+1), 'search_pattern':search_pattern}
            self.addDir(params)
コード例 #10
0
    def listVideos(self, baseUrl, cat, page):
        printDBG("listVideos for url[%s] page[%s]" % (baseUrl, page))
        
        if 1 < int(page) != '1': url = baseUrl + page
        else: url = baseUrl
        sts, data = self.cm.getPage(url)
        if not sts: return
        
        nextPage = False
        if -1 < data.find("class='pagination_next'"):
            nextPage = True

        sts, data = self.getDataBeetwenMarkers(data, '<td class="video">', '</table>', withMarkers = False)
        if not sts: return
        
        data = data.split('<td class="video">')
        for item in data:
            # url & title
            match = re.search('class="video_title"><a href="([^"]+?)">([^<]+?)</a>', item)
            if match: 
                url = match.group(1)
                title = match.group(2)
            else: continue
            # img
            match = re.search('src="([^"]+?)"', item)
            if match: img = match.group(1)
            else: img = ''
            # plot
            match = re.search('<p style="margin:5px;" class="video_details">(.+?)</p>', item, re.DOTALL)
            if match: plot = remove_html_markup(match.group(1))
            else: plot = ''
            
            params = { 'title': title, 'url': url, 'icon': img, 'plot': plot}
            self.playVideo(params)
            
        if nextPage:
            params = {'title': "Następna strona", 'url': baseUrl, 'category': cat, 'page':str(int(page)+1)}
            self.addDir(params)
コード例 #11
0
    def parseListBase(self, data, type='video'):
        printDBG("parseListBase----------------")
        urlPatterns = { 'video'    :    ['video'   , 'href="[ ]*?(/watch\?v=[^"]+?)"'            , ''], 
                        'channel'  :    ['category', 'href="(/[^"]+?)"'                     , ''],
                        'playlist' :    ['category', 'list=([^"]+?)"'                       , '/playlist?list='],
                        'movie'    :    ['video'   , 'data-context-item-id="([^"]+?)"'      , '/watch?v='],
                        'live'     :    ['video'   , 'href="(/watch\?v=[^"]+?)"'            , ''],
                        'tray'     :    ['video'   , 'data-video-id="([^"]+?)"'             , '/watch?v='], }
        currList = []
        for i in range(len(data)):
            #printDBG("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
            # get requaired params
            url   = urlPatterns[type][2] + self.getAttributes(urlPatterns[type][1], data[i])
            
            # get title
            title = '' #self.getAttributes('title="([^"]+?)"', data[i])
            if '' == title: title = self.getAttributes('data-context-item-title="([^"]+?)"', data[i])
            if '' == title: title = self.getAttributes('data-video-title="([^"]+?)"', data[i])
            if '' == title: sts,title = CParsingHelper.getDataBeetwenMarkers(data[i], '<h3 class="yt-lockup-title">', '</h3>', False) 
            if '' == title: sts,title = CParsingHelper.getDataBeetwenReMarkers(data[i], re.compile('<span [^>]*?class="title[^>]*?>'), re.compile('</span>'), False) 
            if '' == title: sts,title = CParsingHelper.getDataBeetwenReMarkers(data[i], re.compile('class="pl-video-title-link[^>]*?>'), re.compile('<'), False)
            
            if '' == title:
                titleMarker = self.cm.ph.getSearchGroups(data[i], '(<[^">]+?"yt-lockup-title[^"]*?"[^>]*?>)')[0]
                if '' != titleMarker:
                    tidx = titleMarker.find(' ')
                    if tidx > 0:
                        tmarker = titleMarker[1:tidx]
                        title = self.cm.ph.getDataBeetwenMarkers(data[i],  titleMarker, '</%s>' % tmarker)[1]
            
            if '' != title: title = CParsingHelper.removeDoubles(remove_html_markup(title, ' '), ' ')
                
            img   = self.getAttributes('data-thumb="([^"]+?\.jpg)"', data[i])
            if '' == img:  img = self.getAttributes('src="([^"]+?\.jpg)"', data[i])
            time  = self.getAttributes('data-context-item-time="([^"]+?)"', data[i])
            if '' == time: time  = self.getAttributes('class="video-time">([^<]+?)</span>', data[i])
            if '' == time: sts, time = CParsingHelper.getDataBeetwenReMarkers(data[i], re.compile('pl-video-time"[^>]*?>'), re.compile('<'), False)
            if '' == time: sts, time = CParsingHelper.getDataBeetwenReMarkers(data[i], re.compile('timestamp"[^>]*?>'), re.compile('<'), False)
            time = time.strip()
            # desc
            sts,desc  = CParsingHelper.getDataBeetwenReMarkers(data[i], re.compile('class="video-description[^>]+?>'), re.compile('</p>'), False)
            if '' == desc: sts,desc = CParsingHelper.getDataBeetwenReMarkers(data[i], re.compile('class="yt-lockup-description[^>]+?>'), re.compile('</div>'), False)
            desc = CParsingHelper.removeDoubles(remove_html_markup(desc, ' '), ' ')
            
            urlTmp = url.split(';')
            if len(urlTmp) > 0: url = urlTmp[0]
            if type == 'video': url = url.split('&')[0] 
                
            # printDBG('url   [%s] ' % url)
            # printDBG('title [%s] ' % title)
            # printDBG('img   [%s] ' % img)
            # printDBG('time  [%s] ' % time)
            # printDBG('desc  [%s] ' % desc)
            if title != '' and url != '' and img != '':
                correctUrlTab = [url, img]
                for i in range(len(correctUrlTab)):
                    if not correctUrlTab[i].startswith('http:') and not correctUrlTab[i].startswith('https:'):
                        if correctUrlTab[i].startswith("//"):
                            correctUrlTab[i] = 'http:' + correctUrlTab[i]
                        else:
                            correctUrlTab[i] = 'http://www.youtube.com' + correctUrlTab[i]
                    else:
                        if correctUrlTab[i].startswith('https:'):
                            correctUrlTab[i] = "http:" + correctUrlTab[i][6:]

                title = clean_html(title.decode("utf-8")).encode("utf-8")
                desc  = clean_html(desc.decode("utf-8")).encode("utf-8")
                params = {'type': urlPatterns[type][0], 'category': type, 'title': title, 'url': correctUrlTab[0], 'icon': correctUrlTab[1], 'time': time, 'desc': desc}
                currList.append(params)

        return currList
コード例 #12
0
    def parseListBase(self, data, type='video'):
        printDBG("parseListBase----------------")
        urlPatterns = {
            'video': ['video', 'href="[ ]*?(/watch\?v=[^"]+?)"', ''],
            'channel': ['category', 'href="(/[^"]+?)"', ''],
            'playlist': ['category', 'list=([^"]+?)"', '/playlist?list='],
            'movie': ['video', 'data-context-item-id="([^"]+?)"', '/watch?v='],
            'live': ['video', 'href="(/watch\?v=[^"]+?)"', ''],
            'tray': ['video', 'data-video-id="([^"]+?)"', '/watch?v='],
        }
        currList = []
        for i in range(len(data)):
            #printDBG("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
            # get requaired params
            url = urlPatterns[type][2] + self.getAttributes(
                urlPatterns[type][1], data[i])

            # get title
            title = ''  #self.getAttributes('title="([^"]+?)"', data[i])
            if '' == title:
                title = self.getAttributes(
                    'data-context-item-title="([^"]+?)"', data[i])
            if '' == title:
                title = self.getAttributes('data-video-title="([^"]+?)"',
                                           data[i])
            if '' == title:
                sts, title = CParsingHelper.getDataBeetwenMarkers(
                    data[i], '<h3 class="yt-lockup-title">', '</h3>', False)
            if '' == title:
                sts, title = CParsingHelper.getDataBeetwenReMarkers(
                    data[i], re.compile('<span [^>]*?class="title[^>]*?>'),
                    re.compile('</span>'), False)
            if '' == title:
                sts, title = CParsingHelper.getDataBeetwenReMarkers(
                    data[i], re.compile('class="pl-video-title-link[^>]*?>'),
                    re.compile('<'), False)

            if '' != title:
                title = CParsingHelper.removeDoubles(
                    remove_html_markup(title, ' '), ' ')

            img = self.getAttributes('data-thumb="([^"]+?\.jpg)"', data[i])
            if '' == img:
                img = self.getAttributes('src="([^"]+?\.jpg)"', data[i])
            time = self.getAttributes('data-context-item-time="([^"]+?)"',
                                      data[i])
            if '' == time:
                time = self.getAttributes('class="video-time">([^<]+?)</span>',
                                          data[i])
            if '' == time:
                sts, time = CParsingHelper.getDataBeetwenReMarkers(
                    data[i], re.compile('pl-video-time"[^>]*?>'),
                    re.compile('<'), False)
            if '' == time:
                sts, time = CParsingHelper.getDataBeetwenReMarkers(
                    data[i], re.compile('timestamp"[^>]*?>'), re.compile('<'),
                    False)
            time = time.strip()
            # desc
            sts, desc = CParsingHelper.getDataBeetwenReMarkers(
                data[i], re.compile('class="video-description[^>]+?>'),
                re.compile('</p>'), False)
            if '' == desc:
                sts, desc = CParsingHelper.getDataBeetwenReMarkers(
                    data[i], re.compile('class="yt-lockup-description[^>]+?>'),
                    re.compile('</div>'), False)
            desc = CParsingHelper.removeDoubles(remove_html_markup(desc, ' '),
                                                ' ')

            urlTmp = url.split(';')
            if len(urlTmp) > 0: url = urlTmp[0]
            if type == 'video': url = url.split('&')[0]

            # printDBG('url   [%s] ' % url)
            # printDBG('title [%s] ' % title)
            # printDBG('img   [%s] ' % img)
            # printDBG('time  [%s] ' % time)
            # printDBG('desc  [%s] ' % desc)
            if title != '' and url != '' and img != '':
                correctUrlTab = [url, img]
                for i in range(len(correctUrlTab)):
                    if not correctUrlTab[i].startswith(
                            'http:') and not correctUrlTab[i].startswith(
                                'https:'):
                        if correctUrlTab[i].startswith("//"):
                            correctUrlTab[i] = 'http:' + correctUrlTab[i]
                        else:
                            correctUrlTab[
                                i] = 'http://www.youtube.com' + correctUrlTab[i]
                    else:
                        if correctUrlTab[i].startswith('https:'):
                            correctUrlTab[i] = "http:" + correctUrlTab[i][6:]

                title = clean_html(title.decode("utf-8")).encode("utf-8")
                desc = clean_html(desc.decode("utf-8")).encode("utf-8")
                params = {
                    'type': urlPatterns[type][0],
                    'category': type,
                    'title': title,
                    'url': correctUrlTab[0],
                    'icon': correctUrlTab[1],
                    'time': time,
                    'desc': desc
                }
                currList.append(params)

        return currList
コード例 #13
0
    def parseListBase(self, data, type='video'):
        printDBG("parseListBase----------------")
        urlPatterns = {
            'video': ['video', 'href="[ ]*?(/watch\?v=[^"]+?)"', ''],
            'channel': ['category', 'href="(/[^"]+?)"', ''],
            'playlist': ['category', 'list=([^"]+?)"', '/playlist?list='],
            'movie': ['video', 'data-context-item-id="([^"]+?)"', '/watch?v='],
            'live': ['video', 'href="(/watch\?v=[^"]+?)"', ''],
            'tray': ['video', 'data-video-id="([^"]+?)"', '/watch?v='],
        }
        currList = []
        for i in range(len(data)):
            #printDBG("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
            # get requaired params
            url = urlPatterns[type][2] + self.getAttributes(
                urlPatterns[type][1], data[i])

            # get title
            title = ''  #self.getAttributes('title="([^"]+?)"', data[i])
            if '' == title:
                title = self.getAttributes(
                    'data-context-item-title="([^"]+?)"', data[i])
            if '' == title:
                title = self.getAttributes('data-video-title="([^"]+?)"',
                                           data[i])
            if '' == title:
                sts, title = CParsingHelper.getDataBeetwenMarkers(
                    data[i], '<h3 class="yt-lockup-title">', '</h3>', False)
            if '' == title:
                sts, title = CParsingHelper.getDataBeetwenReMarkers(
                    data[i], re.compile('<span [^>]*?class="title[^>]*?>'),
                    re.compile('</span>'), False)
            if '' == title:
                sts, title = CParsingHelper.getDataBeetwenReMarkers(
                    data[i], re.compile('class="pl-video-title-link[^>]*?>'),
                    re.compile('<'), False)

            if '' == title:
                titleMarker = self.cm.ph.getSearchGroups(
                    data[i], '(<[^">]+?"yt-lockup-title[^"]*?"[^>]*?>)')[0]
                if '' != titleMarker:
                    tidx = titleMarker.find(' ')
                    if tidx > 0:
                        tmarker = titleMarker[1:tidx]
                        title = self.cm.ph.getDataBeetwenMarkers(
                            data[i], titleMarker, '</%s>' % tmarker)[1]

            if '' != title:
                title = CParsingHelper.removeDoubles(
                    remove_html_markup(title, ' '), ' ')

            img = self.getAttributes('data-thumb="([^"]+?\.jpg[^"]*?)"',
                                     data[i])
            if '' == img:
                img = self.getAttributes('src="([^"]+?\.jpg[^"]*?)"', data[i])
            time = self.getAttributes('data-context-item-time="([^"]+?)"',
                                      data[i])
            if '' == time:
                time = self.getAttributes('class="video-time">([^<]+?)</span>',
                                          data[i])
            if '' == time:
                sts, time = CParsingHelper.getDataBeetwenReMarkers(
                    data[i], re.compile('pl-video-time"[^>]*?>'),
                    re.compile('<'), False)
            if '' == time:
                sts, time = CParsingHelper.getDataBeetwenReMarkers(
                    data[i], re.compile('timestamp"[^>]*?>'), re.compile('<'),
                    False)
            time = time.strip()

            # desc
            descTab = []

            desc = self.cm.ph.getDataBeetwenMarkers(
                data[i], '<div class="yt-lockup-meta', '</div>')[1]
            if desc != '': descTab.append(desc)
            desc = self.cm.ph.getDataBeetwenMarkers(
                data[i], '<span class="formatted-video-count', '</span>')[1]
            if desc != '': descTab.append(desc)

            desc = self.cm.ph.getDataBeetwenReMarkers(
                data[i], re.compile('class="video-description[^>]+?>'),
                re.compile('</p>'), False)[1]
            if '' == desc:
                desc = self.cm.ph.getDataBeetwenReMarkers(
                    data[i], re.compile('class="yt-lockup-description[^>]+?>'),
                    re.compile('</div>'), False)[1]
            if desc != '': descTab.append(desc)

            newDescTab = []
            for desc in descTab:
                desc = self.cm.ph.removeDoubles(remove_html_markup(desc, ' '),
                                                ' ')
                desc = clean_html(desc).strip()
                if desc != '':
                    newDescTab.append(desc)

            urlTmp = url.split(';')
            if len(urlTmp) > 0: url = urlTmp[0]
            if type == 'video': url = url.split('&')[0]
            #printDBG("#####################################")
            #printDBG('url   [%s] ' % url)
            #printDBG('title [%s] ' % title)
            #printDBG('img   [%s] ' % img)
            #printDBG('time  [%s] ' % time)
            #printDBG('desc  [%s] ' % desc)
            if title != '' and url != '' and img != '':
                correctUrlTab = [url, img]
                for i in range(len(correctUrlTab)):
                    if not correctUrlTab[i].startswith(
                            'http:') and not correctUrlTab[i].startswith(
                                'https:'):
                        if correctUrlTab[i].startswith("//"):
                            correctUrlTab[i] = 'http:' + correctUrlTab[i]
                        else:
                            correctUrlTab[
                                i] = 'http://www.youtube.com' + correctUrlTab[i]
                    else:
                        if correctUrlTab[i].startswith('https:'):
                            correctUrlTab[i] = "http:" + correctUrlTab[i][6:]

                title = clean_html(title)
                params = {
                    'type': urlPatterns[type][0],
                    'category': type,
                    'title': title,
                    'url': correctUrlTab[0],
                    'icon': correctUrlTab[1].replace('&amp;', '&'),
                    'time': time,
                    'desc': '[/br]'.join(newDescTab)
                }
                currList.append(params)

        return currList