Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retweets being deleted even with unretweet=false #86

Open
ZhenShuo2021 opened this issue Dec 8, 2024 · 0 comments
Open

Retweets being deleted even with unretweet=false #86

ZhenShuo2021 opened this issue Dec 8, 2024 · 0 comments

Comments

@ZhenShuo2021
Copy link

ZhenShuo2021 commented Dec 8, 2024

Even though unretweet=false, retweets still got deleted.

Description:

  1. Use default configuration, not change any options.
  2. Unable to find the UUID, so I used the endpoint https://x.com/i/api/1.1/keyregistry/register instead of the recommended client_event.json.
  3. Over 1000 retweets were deleted.
  4. It looks like there's no clear pattern to the deleted retweets, but most of them seem to be from before 2024, with fewer getting deleted after that. However, this is just a rough guess.

For those who may have experienced similar issues, you can recover deleted retweets by exporting the log file and using the following script:

import re

def extract_urls(input_file, output_file):
    url_pattern = r"https://t\.co/\S+"

    with open(input_file, 'r') as infile, open(output_file, 'w') as outfile:
        for line in infile:
            if "https://t.co" in line:
                urls = re.findall(url_pattern, line)
                for url in urls:
                    if "…" not in url:
                        outfile.write(url + "\n")

input_file = "x.com.log"
output_file = "extracted_urls.txt"
extract_urls(input_file, output_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant