From 081dfa768016f1cc97202412c65adba6c181832a Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 16 Dec 2023 13:58:42 +0000 Subject: [PATCH] Use new anonymous API endpoint --- test_vx.py | 4 ++++ twExtract/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test_vx.py b/test_vx.py index c00ae01..a1bed7e 100644 --- a/test_vx.py +++ b/test_vx.py @@ -52,6 +52,10 @@ def test_syndicationAPI(): tweet = twExtract.extractStatus_syndication(testMediaTweet,workaroundTokens=tokens) assert tweet["full_text"]==testMediaTweet_compare['description'] +def test_extractStatusV2Anon(): + tweet = twExtract.extractStatusV2AnonLegacy(testMediaTweet,None) + assert tweet["full_text"]==testMediaTweet_compare['description'] + def test_v2API(): tweet = twExtract.extractStatusV2Legacy(testMediaTweet,workaroundTokens=tokens) assert tweet["full_text"]==testMediaTweet_compare['description'] diff --git a/twExtract/__init__.py b/twExtract/__init__.py index 2548b59..194f105 100644 --- a/twExtract/__init__.py +++ b/twExtract/__init__.py @@ -276,7 +276,7 @@ def extractStatusV2AnonLegacy(url,workaroundTokens): return tweet['legacy'] def extractStatus(url,workaroundTokens=None): - methods=[extractStatus_syndication,extractStatusV2Legacy,extractStatus_twExtractProxy] + methods=[extractStatusV2AnonLegacy,extractStatus_syndication,extractStatusV2Legacy,extractStatus_twExtractProxy] for method in methods: try: return method(url,workaroundTokens)