User ID causes 503 error and trips timelines command #656
Description
I am collecting timelines from about 30k user accounts. I encountered a single user ID that trips the timelines
command and causes twarc2 to crash. Here is the error message I get:
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: https://api.twitter.com/2/users/27971300/tweets?expansions=author_id%2Cin_reply_to_user_id%2Creferenced_tweets.id%2Creferenced_tweets.id.author_id%2Centities.mentions.username%2Cattachments.poll_ids%2Cattachments.media_keys%2Cgeo.place_id&tweet.fields=attachments%2Cauthor_id%2Cconversation_id%2Ccreated_at%2Centities%2Cgeo%2Cid%2Cin_reply_to_user_id%2Clang%2Cpublic_metrics%2Ctext%2Cpossibly_sensitive%2Creferenced_tweets%2Creply_settings%2Csource%2Cwithheld&user.fields=created_at%2Cdescription%2Centities%2Cid%2Clocation%2Cname%2Cpinned_tweet_id%2Cprofile_image_url%2Cprotected%2Cpublic_metrics%2Curl%2Cusername%2Cverified%2Cwithheld&media.fields=alt_text%2Cduration_ms%2Cheight%2Cmedia_key%2Cpreview_image_url%2Ctype%2Curl%2Cwidth%2Cpublic_metrics&poll.fields=duration_minutes%2Cend_datetime%2Cid%2Coptions%2Cvoting_status&place.fields=contained_within%2Ccountry%2Ccountry_code%2Cfull_name%2Cgeo%2Cid%2Cname%2Cplace_type&start_time=2022-09-14T00%3A00%3A00%2B00%3A00&end_time=2022-09-15T00%3A00%3A00%2B00%3A00&max_results=100
For my use case, this is very unfortunate because the error is not handled gracefully and the collection of timelines from the list of users crashes and has to be started again, excluding the pathological user ID. Maybe the timelines command could profit from handling this exception explicitely?