[twitter] add faker

This commit is contained in:
Mort Yao 2020-12-17 02:01:23 +01:00
parent b00860e4be
commit 17c740ae54
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -34,7 +34,7 @@ def twitter_download(url, output_dir='.', merge=True, info_only=False, **kwargs)
**kwargs) **kwargs)
return return
html = get_html(url, faker=False) # disable faker to prevent 302 infinite redirect html = get_html(url, faker=True) # now it seems faker must be enabled
screen_name = r1(r'twitter\.com/([^/]+)', url) or r1(r'data-screen-name="([^"]*)"', html) or \ screen_name = r1(r'twitter\.com/([^/]+)', url) or r1(r'data-screen-name="([^"]*)"', html) or \
r1(r'<meta name="twitter:title" content="([^"]*)"', html) r1(r'<meta name="twitter:title" content="([^"]*)"', html)
item_id = r1(r'twitter\.com/[^/]+/status/(\d+)', url) or r1(r'data-item-id="([^"]*)"', html) or \ item_id = r1(r'twitter\.com/[^/]+/status/(\d+)', url) or r1(r'data-item-id="([^"]*)"', html) or \