Telegram-Story-Scraper- python脚本 可让您自动从电报朋友那里刮擦和下载故事

taibeihacker

Moderator
一个Python脚本,可让您使用Telethon库自动从电报朋友那里刮擦和下载故事。该脚本继续并从故事中保存了照片和视频以及他们的元数据。

Important Note About Story Access ️​

由于电报API限制,此脚本只能访问:的故事- 您已添加到朋友列表中的用户- 其隐私设置允许您查看其故事的用户
这是电报API的限制,无法绕过。

Features​

Automatically scrapes all available stories from your Telegram friends Downloads both photos and videos from stories Stores metadata in SQLite database Exports data to Excel spreadsheet Real-time monitoring with customizable intervals Timestamp is set to (UTC+2) Maintains record of previously downloaded stories Resume capability Automatic retry mechanism

Prerequisites​

Before running the script, you'll need:
python 3.7或更高的电报帐户帐户API凭据来自电报上的电报朋友,您想跟踪

Required Python packages​

pip install -r unigess.txt insupper.txt:
电视
OpenPyXl
附表

Getting Telegram API Credentials​

访问https://my.telegram.org/auth登录您的电话号码单击“ API开发工具”填写form: App title3:您的应用程序名称harp name sharp name name name name name short short short short short name platflorm:可以将'desktop'spection 3: appi platsion 3: appi prospi'plats : appi trick 3 trick 3创建,即一个数字API_HASH:一字母的字母和数字确保这些凭据安全,您将需要它们运行脚本!
010-110克隆仓库: git克隆3https://github.com/unnohwn/telegram-story-scraper.git.git
cd telegram-story-scraper Install requirements: pip install -r requirements.txt Run the script: python TGSS.py On first run, you'll be prompted to enter: Your API ID Your API Hash Your phone number (with country code) Verification code (sent to your Telegram) Checking interval in seconds (default is 60)

Setup and Running​

The script: 1. Connects to your电报帐户2。定期检查您的朋友的新故事3。下载任何新故事(照片/视频)4。在SQLITE数据库5中存储元数据。将信息导出到Excel文件6。连续运行直至中断(CTRL+C)

How It Works​

010-110 SQLITE数据库包含: -USER_ID:故事创建者的Telegram用户ID -story_id:独特的故事标识符-TimestAmp: timestamp:故事时(utc+2) - filename 3333333333333333333333333333333333333333333:

Data Storage​

导出文件包含与数据库相同的信息,有用的:-轻松查看故事元数据- 过滤和排序- 数据分析- 与他人共享数据

Database Structure (stories.db)​

照片保存为AS: {user_id} _ {story_id} .jpg视频。 (违约: 60秒)持续持续到直到手动停止保持状态之间的状态避免下载

CSV and Excel Export (stories_export.csv/xlsx)​

同时支持照片和视频自动检测媒体类型可在原始质量中生成唯一的fileNames生成唯一的文件名生成唯一的文件名:01010-010-1110脚本包括: - 自动重新误差- 误差- 误差- 误差- 误差- 误差- 借用误差- 中断

Media Storage​

受电报的速率限制故事必须目前处于活动状态(未过期)媒体下载尺寸限制根据电报的限制适用

Features in Detail​

捐款!请随时提交拉动请求。

Continuous Monitoring​

此项目是根据MIT许可证获得许可的- 有关详细信息,请参见许可证文件。

Media Handling​

此工具仅用于教育目的。确保TO :-尊重Telegram的服务条款- 在刮擦之前获得必要的权限- 在负责任和道德上使用- 遵守数据保护法规- 尊重用户隐私
 
返回
上方