Exemple #1
0
    def __GetYouTubeId(text):
        url = urlparse.urlparse(JobCommon.__AddHttpToUrl(text))
        if url.netloc == "youtube.com" or url.netloc == "www.youtube.com":
            params = ParseQueryString(url.query)
            youTubeIdList = params.get("v")
            if youTubeIdList is not None:
                return youTubeIdList[0]

        return ""
Exemple #2
0
 def GetPtpOrImdbId(releaseInfo, text):
     imdbId = NfoParser.GetImdbId(text)
     if len(imdbId) > 0:
         releaseInfo.ImdbId = imdbId
     elif text == "0" or text == "-":
         releaseInfo.SetZeroImdbId()
     else:
         # Using urlparse because of torrent permalinks:
         # https://passthepopcorn.me/torrents.php?id=9730&torrentid=72322
         url = urlparse.urlparse(JobCommon.__AddHttpToUrl(text))
         if url.netloc == "passthepopcorn.me" or url.netloc == "www.passthepopcorn.me" or url.netloc == "tls.passthepopcorn.me":
             params = ParseQueryString(url.query)
             ptpIdList = params.get("id")
             if ptpIdList is not None:
                 releaseInfo.PtpId = ptpIdList[0]