Comments (4)
On another look, this may require some further digging. Technically, we already should be handling this - "twarc1" and "twarc2" should both handle retries for timeouts, and not retry for 404s. But it seems like 404s aren't being caught properly in twarc1 right now. So maybe there is a bug there:
twarc users acthatnotexist1
Should output a handled error, but instead
Traceback (most recent call last):
File "/python/bin/twarc", line 11, in <module>
load_entry_point('twarc', 'console_scripts', 'twarc')()
File "/python/twarc/twarc/command.py", line 293, in main
for thing in things:
File "/python/twarc/twarc/client.py", line 372, in user_lookup
for u in do_lookup():
File "/python/twarc/twarc/client.py", line 361, in do_lookup
raise e
File "/python/twarc/twarc/client.py", line 357, in do_lookup
resp = self.get(url, params=params, allow_404=True)
File "/python/twarc/twarc/decorators.py", line 88, in new_f
resp.raise_for_status()
File "/python/lib/python3.7/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.twitter.com/1.1/users/lookup.json?screen_name=acthatnotexist1&tweet_mode=extended
A stack trace. I haven't fully replicated timeouts yet.
As an alternative - does twarc2
work better here? When users are not found, it returns an error message you can parse instead of 404 errors:
twarc2 user name accountthatdoesnotexist111
[
{
"errors": [
{
"value": "acthatnotexist1",
"detail": "Could not find user with usernames: [acthatnotexist1].",
"title": "Not Found Error",
"resource_type": "user",
"parameter": "usernames",
"resource_id": "acthatnotexist1",
"type": "https://api.twitter.com/2/problems/resource-not-found"
}
],
"__twarc": {...
}
}
]
from twarc.
If twarc2
implies having API2 access, that's a separate issue I haven't find a way to clarify: I don't have API2 access, and I'm afraid applying for it means risking my existing API1.1 access. Until then, I need to stick with 1.1.
I am ready to provide stacktrace and any further diagnostics for request timeout cases if that can help us to have some progress.
from twarc.
Oh, i see what you mean - i don't know about losing v1.1 Access, but as far as i know, brand new API accounts all get v2 access. Keeping this open for the v1.1 Errors bug tho - i'll double check stuff there for now.
from twarc.
Similar problem with twarc {friends|followers}
when account is protected: exit code for requests.exceptions.HTTPError: 401
is the same 1
as for requests.exceptions.ReadTimeout
.
from twarc.
Related Issues (20)
- How to use Academic API to search archives with language filters? HOT 2
- How to extract the author user name of a retweet? HOT 1
- Twarc API V2 function to get conversations HOT 1
- Is it possible to use "next_token"? HOT 3
- Missing `variants` field in `media.fields`
- Add `include_ext_is_blue_verified=True`
- Have twarc2 400 error while searching phrases. HOT 1
- CLI Errors fail to show for invalid input file
- CLI Errors fail to show for invalid input file HOT 1
- twarc2 timeline --no-context-annotations not pulling 500 tweets HOT 2
- Adding query parameters to search terms imported via .txt? HOT 1
- Is it possible to convert twarc jsnol files to twarc2 jsonl files? HOT 2
- Impossible to specify No expansions at all in CLI.
- Implement new compliance Streams
- Cannot find user_verified_type in the tweet metadata HOT 18
- twarc2 hydrate HOT 2
- twarc2 hydrate freezes at 20% HOT 3
- Client forbidden HOT 3
- Forbidden error after few tweets hydrated (403) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twarc.