twix-dl


Nametwix-dl JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryAn unofficial X scraper and downloader
upload_time2025-10-14 09:16:38
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords twitter downloader media parser
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TwiX-dl

[![PyPI version](https://badge.fury.io/py/twix-dl.svg)](https://badge.fury.io/py/twix-dl)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

<img src="https://raw.githubusercontent.com/JellyTyan/twix-dl/main/.github/assets/twix.png" height="300px"/>

`twix-dl` is a Python library (and future CLI tool) for extracting tweet metadata and downloading all media attachments (photos, videos, GIFs) from a Twitter/X post.

## 📦 Installation

```bash
pip install twix-dl
```

**Or install from source:**

```bash
git clone https://github.com/JellyTyan/twix-dl.git
cd twix-dl
pip install -e .
```



---

## 📚 Data Structures

```python
@dataclass
class AuthorData:
    id: str
    rest_id: str
    name: str
    screen_name: str
    url: str
    avatar_url: str
    profile_banner_url: str
    description: str
    is_blue_verified: bool
    favourites_count: int
    followers_count: int

@dataclass
class TweetMedia:
    type: Literal["photo", "video", "gif"]
    url: str
    width: Optional[int] = None
    height: Optional[int] = None
    duration: Optional[int] = None  # for videos/GIFs
    size: Optional[int] = None      # file size in bytes

@dataclass
class TweetInfo:
    tweet_id: str
    url: str
    full_text: Optional[str]
    author: AuthorData
    media: List[TweetMedia]
    favorite_count: Optional[int] = None
    retweet_count: Optional[int] = None
    reply_count: Optional[int] = None
    quote_count: Optional[int] = None
    lang: Optional[str] = None

@dataclass
class ErrorExtensions:
    name: str
    source: str
    code: int
    kind: str
    trace_id: Optional[str] = None

@dataclass
class TwitterError:
    """Twitter API error response"""
    message: str
    code: int
    kind: str
    name: str
    source: str
    trace_id: Optional[str]
    extensions: ErrorExtensions

@dataclass(frozen=True)
class GraphQLOperation:
    """GraphQL operation definition for Twitter API"""
    variables_schema: Dict[str, Any]
    operation_id: str
    name: str
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "twix-dl",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "twitter, downloader, media, parser",
    "author": null,
    "author_email": "JellyTyan <jellytyan@jellytyan.de>",
    "download_url": "https://files.pythonhosted.org/packages/55/70/c08754122050d08992846db99a4292e19cbb9da437495c0c7b55ec09c369/twix_dl-0.2.0.tar.gz",
    "platform": null,
    "description": "# TwiX-dl\n\n[![PyPI version](https://badge.fury.io/py/twix-dl.svg)](https://badge.fury.io/py/twix-dl)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n\n<img src=\"https://raw.githubusercontent.com/JellyTyan/twix-dl/main/.github/assets/twix.png\" height=\"300px\"/>\n\n`twix-dl` is a Python library (and future CLI tool) for extracting tweet metadata and downloading all media attachments (photos, videos, GIFs) from a Twitter/X post.\n\n## \ud83d\udce6 Installation\n\n```bash\npip install twix-dl\n```\n\n**Or install from source:**\n\n```bash\ngit clone https://github.com/JellyTyan/twix-dl.git\ncd twix-dl\npip install -e .\n```\n\n\n\n---\n\n## \ud83d\udcda Data Structures\n\n```python\n@dataclass\nclass AuthorData:\n    id: str\n    rest_id: str\n    name: str\n    screen_name: str\n    url: str\n    avatar_url: str\n    profile_banner_url: str\n    description: str\n    is_blue_verified: bool\n    favourites_count: int\n    followers_count: int\n\n@dataclass\nclass TweetMedia:\n    type: Literal[\"photo\", \"video\", \"gif\"]\n    url: str\n    width: Optional[int] = None\n    height: Optional[int] = None\n    duration: Optional[int] = None  # for videos/GIFs\n    size: Optional[int] = None      # file size in bytes\n\n@dataclass\nclass TweetInfo:\n    tweet_id: str\n    url: str\n    full_text: Optional[str]\n    author: AuthorData\n    media: List[TweetMedia]\n    favorite_count: Optional[int] = None\n    retweet_count: Optional[int] = None\n    reply_count: Optional[int] = None\n    quote_count: Optional[int] = None\n    lang: Optional[str] = None\n\n@dataclass\nclass ErrorExtensions:\n    name: str\n    source: str\n    code: int\n    kind: str\n    trace_id: Optional[str] = None\n\n@dataclass\nclass TwitterError:\n    \"\"\"Twitter API error response\"\"\"\n    message: str\n    code: int\n    kind: str\n    name: str\n    source: str\n    trace_id: Optional[str]\n    extensions: ErrorExtensions\n\n@dataclass(frozen=True)\nclass GraphQLOperation:\n    \"\"\"GraphQL operation definition for Twitter API\"\"\"\n    variables_schema: Dict[str, Any]\n    operation_id: str\n    name: str\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An unofficial X scraper and downloader",
    "version": "0.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/JellyTyan/twix-dl/issues",
        "Documentation": "https://github.com/JellyTyan/twix-dl#readme",
        "Homepage": "https://github.com/JellyTyan/twix-dl",
        "Repository": "https://github.com/JellyTyan/twix-dl"
    },
    "split_keywords": [
        "twitter",
        " downloader",
        " media",
        " parser"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b9a3d345d18e26179b3341502f847389191f234aa8da548c9f789650212d01b6",
                "md5": "19a419d4abfb2af45ecb98187ea36356",
                "sha256": "1496f5b25328b6c04ebd6fc066a1d39a0eb71400c467093704ca39ccf6c08f67"
            },
            "downloads": -1,
            "filename": "twix_dl-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "19a419d4abfb2af45ecb98187ea36356",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 10163,
            "upload_time": "2025-10-14T09:16:38",
            "upload_time_iso_8601": "2025-10-14T09:16:38.136100Z",
            "url": "https://files.pythonhosted.org/packages/b9/a3/d345d18e26179b3341502f847389191f234aa8da548c9f789650212d01b6/twix_dl-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5570c08754122050d08992846db99a4292e19cbb9da437495c0c7b55ec09c369",
                "md5": "86b934ce620c22ee3f8e33d5289cff49",
                "sha256": "794dcf7acc9a4004e0b3183c3e8042e7957c4b27271fef6fe666c3163d83e0a0"
            },
            "downloads": -1,
            "filename": "twix_dl-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "86b934ce620c22ee3f8e33d5289cff49",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 10689,
            "upload_time": "2025-10-14T09:16:38",
            "upload_time_iso_8601": "2025-10-14T09:16:38.975315Z",
            "url": "https://files.pythonhosted.org/packages/55/70/c08754122050d08992846db99a4292e19cbb9da437495c0c7b55ec09c369/twix_dl-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-14 09:16:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JellyTyan",
    "github_project": "twix-dl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "twix-dl"
}
        
Elapsed time: 1.83255s