JustAnotherArchivist / snscrape

A social networking service scraper in Python
GNU General Public License v3.0
4.51k stars 712 forks source link

Twitter api blocked #969

Closed hrushi9 closed 1 year ago

hrushi9 commented 1 year ago

Describe the bug

Hey! I faced this error, to keep things clear i am not using Any cloud service, vpn and iam using latest version of snscrape.

The error message you received indicates that the requests to the Twitter API for retrieving tweets failed due to being blocked (403).

How to reproduce

import snscrape.modules.twitter as sntwitter
import pandas as pd

query = "python"

for tweet in sntwitter.TwitterSearchScraper(query).get_items():
    print(vars(tweet))
    break

Expected behaviour

.

Screenshots and recordings

No response

Operating system

Linux

Python version: output of python3 --version

3.11.1

snscrape version: output of snscrape --version

snscrape-0.6.2.20230320

Scraper

twitter

How are you using snscrape?

CLI (snscrape ... as a command, e.g. in a terminal)

Backtrace

snscrape.base.ScraperException: 4 requests to https://api.twitter.com/2/search/adaptive.json?include_profile_interstitial_type=1&include_blocking=1&include_blocked_by=1&include_followe d_by=1&include_want_retweets=1&include_mute_edge=1&include_can_dm=1&include_can_media_tag=1&include_ext_has_nft_avatar=1&include_ext_is_blue_verified=1&include_ext_verified_type=1&skip _status=1&cards_platform=Web-12&include_cards=1&include_ext_alt_text=true&include_ext_limited_action_results=false&include_quote_count=true&include_reply_count=1&tweet_mode=extended&in clude_ext_collab_control=true&include_ext_views=true&include_entities=true&include_user_entities=true&include_ext_media_color=true&include_ext_media_availability=true&include_ext_sensi tive_media_warning=true&include_ext_trusted_friends_metadata=true&send_error_codes=true&simple_quoted_tweet=true&q=Modi&tweet_search_mode=live&count=20&query_source=spellingexpansion revert_click&pc=1&spelling_corrections=1&include_ext_edit_control=true&ext=mediaStats%2ChighlightedLabel%2ChasNftAvatar%2CvoiceInfo%2Cenrichments%2CsuperFollowMetadata%2CunmentionInfo%2CeditControl%2Ccollab_control%2Cvibe failed, giving up. PS E:\Python Projects\Threqathunter\testenv>

Log output

No response

Dump of locals

No response

Additional context

No response

JustAnotherArchivist commented 1 year ago

846