# Download videos from toutiao.com
## Installation
```bash
python3 -m pip install toutiao-video
```
## Usage
### Use in CMD
```bash
toutiao --help
# download videos from user feed
toutiao feed -u xxxxx -t xxxxx
toutiao feed -u xxxxx -t xxxxx -O output
toutiao feed -u xxxxx -t xxxxx -l 5
toutiao feed -u xxxxx -t xxxxx -l 1 -d 1080p
toutiao feed -u xxxxx -t xxxxx -l 10 --dryrun
# download video from video url
toutiao video -t xxxxx <video_url>
toutiao video -t xxxxx <video_url> -d 1080p
toutiao video -t xxxxx <video_url> -d 1080p -O output
toutiao video -t xxxxx <video_url> -d 1080p -O output --dryrun
```
### Use in Python
```python
# download videos from user feed
from toutiao.core import TouTiao
toutiao = TouTiao(user_id='user_id', tt_webid='tt_webid')
for n, item in enumerate(toutiao.list_user_feed(), 1):
if n > 5:
break()
print(item)
# download video from video url
from toutiao.video import ToutiaoVideo
video = ToutiaoVideo(url='<your_video_url>', ttwid='<your_ttwid>')
initial_video = video.get_initial_video()
print(initial_video)
# video.download()
```
## Help
- `tt-webid` and `ttwid`
you can get the value from `Network > Request Headers > Cookie` or `Application > Cookies` on your browser.
Raw data
{
"_id": null,
"home_page": "https://github.com/suqingdong/toutiao",
"name": "toutiao-video",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "suqingdong",
"author_email": "suqingdong1114@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/fd/72/00ad1444cb491b89e999f1b042bdeff3edb32882dc07947e69f2137ee552/toutiao-video-1.0.1.tar.gz",
"platform": null,
"description": "# Download videos from toutiao.com\n\n## Installation\n\n```bash\npython3 -m pip install toutiao-video\n```\n\n## Usage\n\n### Use in CMD\n```bash\ntoutiao --help\n\n# download videos from user feed\ntoutiao feed -u xxxxx -t xxxxx\ntoutiao feed -u xxxxx -t xxxxx -O output\ntoutiao feed -u xxxxx -t xxxxx -l 5\ntoutiao feed -u xxxxx -t xxxxx -l 1 -d 1080p\ntoutiao feed -u xxxxx -t xxxxx -l 10 --dryrun\n\n# download video from video url\ntoutiao video -t xxxxx <video_url>\ntoutiao video -t xxxxx <video_url> -d 1080p\ntoutiao video -t xxxxx <video_url> -d 1080p -O output\ntoutiao video -t xxxxx <video_url> -d 1080p -O output --dryrun\n```\n\n### Use in Python\n\n```python\n\n# download videos from user feed\nfrom toutiao.core import TouTiao\n\ntoutiao = TouTiao(user_id='user_id', tt_webid='tt_webid')\n\nfor n, item in enumerate(toutiao.list_user_feed(), 1):\n if n > 5:\n break()\n print(item) \n\n# download video from video url\nfrom toutiao.video import ToutiaoVideo\nvideo = ToutiaoVideo(url='<your_video_url>', ttwid='<your_ttwid>')\ninitial_video = video.get_initial_video()\nprint(initial_video)\n# video.download()\n```\n\n\n## Help\n\n- `tt-webid` and `ttwid`\nyou can get the value from `Network > Request Headers > Cookie` or `Application > Cookies` on your browser.\n\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Video downloader for Toutiao",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/suqingdong/toutiao"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2457d066250f9c99d61b0aa450d3a93310d2ebaf306fdf95e141d1950e5f0be2",
"md5": "2be3252e62e45f7f3d1932a67538a851",
"sha256": "fff3a3f53837278a8e5c1d0f4407191953f2d68cd8087c2c2dabcfdf394dc44a"
},
"downloads": -1,
"filename": "toutiao_video-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2be3252e62e45f7f3d1932a67538a851",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6125,
"upload_time": "2025-01-03T08:44:19",
"upload_time_iso_8601": "2025-01-03T08:44:19.026100Z",
"url": "https://files.pythonhosted.org/packages/24/57/d066250f9c99d61b0aa450d3a93310d2ebaf306fdf95e141d1950e5f0be2/toutiao_video-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fd7200ad1444cb491b89e999f1b042bdeff3edb32882dc07947e69f2137ee552",
"md5": "7a449b36d9b6c2a24c5a7301d6d6cebf",
"sha256": "9c6ef144af8425c28f3983c321e52e542a1f874ec65f51fd73d22d1301ef1d76"
},
"downloads": -1,
"filename": "toutiao-video-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "7a449b36d9b6c2a24c5a7301d6d6cebf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5411,
"upload_time": "2025-01-03T08:44:20",
"upload_time_iso_8601": "2025-01-03T08:44:20.671718Z",
"url": "https://files.pythonhosted.org/packages/fd/72/00ad1444cb491b89e999f1b042bdeff3edb32882dc07947e69f2137ee552/toutiao-video-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-03 08:44:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "suqingdong",
"github_project": "toutiao",
"github_not_found": true,
"lcname": "toutiao-video"
}