Return to using extractStatusV2Anon
This commit is contained in:
@@ -495,7 +495,7 @@ def fixTweetData(tweet):
|
|||||||
|
|
||||||
def extractStatus(url,workaroundTokens=None):
|
def extractStatus(url,workaroundTokens=None):
|
||||||
# TODO: commented out methods are too slow/unreliable at the moment
|
# TODO: commented out methods are too slow/unreliable at the moment
|
||||||
methods=[extractStatus_syndication,extractStatusV2]#,extractStatusV2Android,extractStatusV2TweetDetail] #
|
methods=[extractStatusV2Anon,extractStatusV2]#,extractStatusV2Android,extractStatusV2TweetDetail] #
|
||||||
for method in methods:
|
for method in methods:
|
||||||
try:
|
try:
|
||||||
result = method(url,workaroundTokens)
|
result = method(url,workaroundTokens)
|
||||||
|
|||||||
13
vxApi.py
13
vxApi.py
@@ -23,9 +23,10 @@ def getApiUserResponse(user):
|
|||||||
def getApiResponse(tweet,include_txt=False,include_rtf=False):
|
def getApiResponse(tweet,include_txt=False,include_rtf=False):
|
||||||
tweetL = tweet["legacy"]
|
tweetL = tweet["legacy"]
|
||||||
if "user_result" in tweet["core"]:
|
if "user_result" in tweet["core"]:
|
||||||
userL = tweet["core"]["user_result"]["result"]["legacy"]
|
user = tweet["core"]["user_result"]["result"]
|
||||||
elif "user_results" in tweet["core"]:
|
elif "user_results" in tweet["core"]:
|
||||||
userL = tweet["core"]["user_results"]["result"]["legacy"]
|
user = tweet["core"]["user_results"]["result"]
|
||||||
|
userL = user["legacy"]
|
||||||
media=[]
|
media=[]
|
||||||
media_extended=[]
|
media_extended=[]
|
||||||
hashtags=[]
|
hashtags=[]
|
||||||
@@ -33,6 +34,14 @@ def getApiResponse(tweet,include_txt=False,include_rtf=False):
|
|||||||
oldTweetVersion = False
|
oldTweetVersion = False
|
||||||
tweetArticle=None
|
tweetArticle=None
|
||||||
lang=None
|
lang=None
|
||||||
|
|
||||||
|
if "screen_name" not in userL:
|
||||||
|
userL["screen_name"] = user["core"]["screen_name"]
|
||||||
|
if "name" not in userL:
|
||||||
|
userL["name"] = user["core"]["name"]
|
||||||
|
if "profile_image_url_https" not in userL:
|
||||||
|
userL["profile_image_url_https"] = user["avatar"]["image_url"]
|
||||||
|
|
||||||
#editedTweet=False
|
#editedTweet=False
|
||||||
try:
|
try:
|
||||||
if "birdwatch_pivot" in tweet:
|
if "birdwatch_pivot" in tweet:
|
||||||
|
|||||||
Reference in New Issue
Block a user