This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#I write the slot of QClipboard::dataChanged() as this to avoid the bug, | |
@pyqtSlot() | |
def detectClipboardUrl(self): | |
clipboardText = self.clipboard.text() | |
if getattr(self.clipboard, 'lastClipboardUrl', None) != clipboardText: | |
url = clipboardText | |
setattr(self.clipboard, 'lastClipboardUrl', url) | |
#会造成不能连续复制同样的url | |
self.on_autodownloadEnable_triggered() # 立即断开 Clipboard的信号联系,# 为了防止chrome造成signal call twice的bug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if 'le.com' in sourceUrl and not isYougetParsed: # ykdl解析乐视 | |
videoUrls = re.search(r"Real URLs:\s*(?P<videoUrls>\S*)", parseResult, re.IGNORECASE).group('videoUrls').split() # 搜寻链接,因为有了download-url:,所以必须从Real URLs:后面搜寻,一个本地地址是连续不断的,所以用\S没问题 | |
else: | |
videoUrls = re.findall(r'''\s*[\[']*(?P<videoUrls>https?://\S*)['\]]*''', parseResult) # 因为url是连续不断的,所以用\S没问题,因为是贪婪模式,并且后面的']可选,所以结果里会有'] | |
videoUrls = list(map(lambda videoUrl: videoUrl.rstrip("']"), videoUrls)) | |
# videoUrlsMatch | |
# print('videoUrls----------', videoUrlsMatch.group('videoUrls')) | |
if not all([baseNameMatch, videoUrls]): # 有空结果 |
NewerOlder