コード例 #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 ""
コード例 #2
0
ファイル: JobCommon.py プロジェクト: wmwwmv/PtpUploader
	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 ""
コード例 #3
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]
コード例 #4
0
ファイル: JobCommon.py プロジェクト: wmwwmv/PtpUploader
	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 ]