Skip promoted tweets/ads

Fixes #67
This commit is contained in:
JustAnotherArchivist
2020-08-11 20:28:35 +00:00
parent 4d3d0fe0d7
commit 966a6ebd8e

View File

@@ -188,6 +188,8 @@ class TwitterSearchScraper(TwitterCommonScraper):
for entry in entries:
if entry['entryId'].startswith('sq-I-t-'):
if 'tweet' in entry['content']['item']['content']:
if 'promotedMetadata' in entry['content']['item']['content']['tweet']: # Promoted tweet aka ads
continue
tweet = obj['globalObjects']['tweets'][entry['content']['item']['content']['tweet']['id']]
elif 'tombstone' in entry['content']['item']['content'] and 'tweet' in entry['content']['item']['content']['tombstone']:
tweet = obj['globalObjects']['tweets'][entry['content']['item']['content']['tombstone']['tweet']['id']]