[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-79623":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":14,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":16,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":8,"pushedAt":8,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":13,"starSnapshotCount":13,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},79623,"tiktok-scraper","riyagoelrs\u002Ftiktok-scraper","riyagoelrs",null,"Python",148,15,34,0,1,33,41.41,false,"main",true,[],"2026-06-12 04:01:25","# TikTok Scraper\n\nA Python scraper for pulling public TikTok video data using the unofficial [TikTokApi](https:\u002F\u002Fgithub.com\u002Fdavidteather\u002FTikTok-Api) library. Supports scraping by hashtag, username, trending feed, or search keyword.\n\n## Features\n\n- Scrape videos by **hashtag**, **user**, **trending**, or **search**\n- Extracts: views, likes, comments, shares, caption, hashtags, author info, video URL, music\n- Outputs clean **JSON files** with auto-generated filenames\n- Supports `msToken` for authenticated sessions (reduces bot detection)\n\n## Setup\n\n**Requirements:** Python 3.9+\n\n```bash\npip install TikTokApi\nplaywright install chromium\n```\n\n## Usage\n\n```bash\n# By hashtag\npython tiktok_scraper.py --mode hashtag --query cooking --count 50\n\n# By user\npython tiktok_scraper.py --mode user --query charlidamelio --count 30\n\n# Trending feed\npython tiktok_scraper.py --mode trending --count 20\n\n# Search\npython tiktok_scraper.py --mode search --query \"pasta recipe\" --count 40\n```\n\nOutput is saved to `.\u002Foutput\u002Ftiktok_\u003Cmode>_\u003Cquery>_\u003Ctimestamp>.json`.\n\n## Getting an msToken (recommended)\n\nTikTok may block requests without a session token. To get one:\n\n1. Open [tiktok.com](https:\u002F\u002Fwww.tiktok.com) in your browser and scroll around\n2. Open DevTools → Application → Cookies → `www.tiktok.com`\n3. Copy the value of the cookie named `msToken`\n4. Pass it via flag or environment variable:\n\n```bash\n# via flag\npython tiktok_scraper.py --mode user --query yourname --ms-token YOUR_TOKEN\n\n# via env var\nexport TIKTOK_MS_TOKEN=YOUR_TOKEN\npython tiktok_scraper.py --mode user --query yourname\n```\n\n## Output fields\n\nEach video in the JSON includes:\n\n| Field | Description |\n|-------|-------------|\n| `id` | TikTok video ID |\n| `created_at` | Upload timestamp (UTC) |\n| `description` | Caption text |\n| `hashtags` | List of hashtag names |\n| `views` | Total play count |\n| `likes` | Like count |\n| `comments` | Comment count |\n| `shares` | Share count |\n| `author_username` | TikTok handle |\n| `author_nickname` | Display name |\n| `author_followers` | Follower count |\n| `author_verified` | Verified status |\n| `video_url` | Direct download URL (expires) |\n| `cover_url` | Thumbnail URL |\n| `duration_sec` | Video length in seconds |\n| `music_title` | Audio track name |\n\n## Notes\n\n- This uses the **unofficial** TikTokApi — TikTok occasionally changes their internals and breaks it. Run `pip install --upgrade TikTokApi` if things stop working.\n- `video_url` download links expire after a few hours.\n- Scraping TikTok without permission may violate their ToS. Use responsibly.\n\n## License\n\nMIT\n","该项目是一个基于Python的TikTok数据抓取工具，使用非官方的TikTokApi库来获取公开的TikTok视频信息。其核心功能包括通过标签、用户名、热门趋势或关键词搜索来抓取视频，并能提取如浏览量、点赞数、评论数等详细信息，输出为JSON格式文件。支持使用msToken进行认证会话以降低被检测为机器人的风险。适用于需要收集和分析TikTok平台上的内容数据的研究者、营销人员或开发者。注意，频繁抓取可能违反TikTok的服务条款，请谨慎使用。",2,"2026-06-11 03:58:10","CREATED_QUERY"]