{"id":13821182,"url":"https://github.com/shalvah/DownloadThisVideo","last_synced_at":"2025-05-16T12:32:56.039Z","repository":{"id":37431400,"uuid":"133681780","full_name":"shalvah/DownloadThisVideo","owner":"shalvah","description":"Twitter bot for easily downloading videos/GIFs off tweets","archived":true,"fork":false,"pushed_at":"2023-09-05T19:30:27.000Z","size":688,"stargazers_count":664,"open_issues_count":3,"forks_count":80,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-11-19T21:36:01.565Z","etag":null,"topics":["aws-lambda","bot","lambda-functions","nodejs","serverless","twitter"],"latest_commit_sha":null,"homepage":"http://download-this.video","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shalvah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-05-16T14:52:04.000Z","updated_at":"2024-11-03T06:06:55.000Z","dependencies_parsed_at":"2024-01-13T16:23:49.235Z","dependency_job_id":"d4756dba-55f9-4221-8ded-c90403ce96fe","html_url":"https://github.com/shalvah/DownloadThisVideo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shalvah%2FDownloadThisVideo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shalvah%2FDownloadThisVideo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shalvah%2FDownloadThisVideo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shalvah%2FDownloadThisVideo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shalvah","download_url":"https://codeload.github.com/shalvah/DownloadThisVideo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254530627,"owners_count":22086648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","bot","lambda-functions","nodejs","serverless","twitter"],"created_at":"2024-08-04T08:01:16.976Z","updated_at":"2025-05-16T12:32:50.960Z","avatar_url":"https://github.com/shalvah.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# DownloadThisVideo\n\n\u003e On April 4, 2023, Twitter suspended @this_vid, after nearly 5 years and millions of users. 😢\n\nEasily download videos/GIFs off Twitter. Mention the bot (@this_vid) in a reply to the tweet containing the video, and it'll reply with a download link in a few minutes.\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n![](./this-vid.png)\n\n## How this works\n## Stack\n- [AWS Lambda](https://aws.amazon.com/lambda/) with the [Serverless Framework](http://serverless.com)\n- [AWS SNS](http://aws.amazon.com/sns)\n- [Redis](http://redis.io)\n- Node.js\n\n### Implementation\nThe bot consists of several AWS Lambda functions that work in tandem:\n\n#### fetchTweetsToDownload\nThis function runs every 4 minutes and checks for new mentions. It publishes these new mentions as a new notification on an SNS topic. The 4-minute interval is so as to not hit Twitter's rate limits and minimize AWS Lambda usage time, while being near-realtime.\n\n\n#### sendDownloadLink\nThis is triggered by new notifications on the SNS topic. It:\n- processes the tweets in the message body,\n- calls Twitter's API to retrieve media links. Any video links retrieved for a tweet are stored in Redis for faster repeated access (other users requesting the same video).\n- adds the download details to the user's store in Redis. The _user's store_ is an entry in Redis where all downloads requested by a user are cached for a certain period (48 hours).\n- attempts to reply to the user with a link to the user's download page (see section below). \"Attempts\" because  Twitter enforces tweet limits (2400 per day, counted in 15-minute periods). If the API limits have been reached, the bot will \"cool down\" (not send any replies) for 10 minutes.\n\n#### getDownloads\nThis is triggered by a HTTP request to the \u003cAWS API Gateway URL\u003e/\u003cTwitter-handle\u003e (for instance, http://thisvid.space/jack). It renders a page showing a list of the user's recent downloads.\n\n#### getHomePage\nRenders the homepage 😁. See http://thisvid.space.\n\n#### retryFailedTasks\nThis re-publishes failed tasks (stored in Redis) as a new SNS message. For now, it can only be triggered manually.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshalvah%2FDownloadThisVideo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshalvah%2FDownloadThisVideo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshalvah%2FDownloadThisVideo/lists"}