This commit is contained in:
2026-05-10 06:47:20 +00:00
parent 26fff59001
commit 6b5b39a625

View File

@@ -1647,9 +1647,6 @@ def get_recent_bsky_posts(client, handle, limit=30):
urls.extend(extract_non_x_urls_from_text(text)) urls.extend(extract_non_x_urls_from_text(text))
urls.extend(extract_urls_from_facets(record)) urls.extend(extract_urls_from_facets(record))
canonical_non_x_urls = set()
for url in urls:
if not is_tco_domain(url) and not is_x_or_twitter_domain(url):
canonical = canonicalize_url(normalize_urlish_token(url) or url) canonical = canonicalize_url(normalize_urlish_token(url) or url)
if canonical: if canonical:
canonical_non_x_urls.add(canonical) canonical_non_x_urls.add(canonical)
@@ -1702,7 +1699,6 @@ def get_rate_limit_wait_seconds(error_obj, default_delay):
if x_after: if x_after:
return min(max(int(x_after), 1), BSKY_LOGIN_MAX_DELAY) return min(max(int(x_after), 1), BSKY_LOGIN_MAX_DELAY)
reset_value = headers.get("ratelimit-reset") or headers.get("RateLimit-Reset") reset_value = headers.get("ratelimit-reset") or headers.get("RateLimit-Reset")
if reset_value: if reset_value:
wait_seconds = max(int(reset_value) - now_ts + 1, default_delay) wait_seconds = max(int(reset_value) - now_ts + 1, default_delay)
@@ -3343,6 +3339,8 @@ def sync_feeds(args):
except Exception as e: except Exception as e:
logging.error(f"❌ Error during sync cycle: {e}") logging.error(f"❌ Error during sync cycle: {e}")
def main(): def main():
load_dotenv() load_dotenv()
@@ -3421,5 +3419,7 @@ load_dotenv()
reset_caches() reset_caches()
sync_feeds(args) sync_feeds(args)
logging.info("🤖 Bot finished.") logging.info("🤖 Bot finished.")
if name == "main":
if __name__ == "__main__":
main() main()