Steps:
-
Go to Telegram Apps to get api_id and api_hash
-
Clone repo by
git clone https://github.com/mzarchi/telegram.git
-
Install lib by
pip install -r requirements.txt
-
Copy
.env.example
to.env
and put your api_id and api_hash withcp .env.example .env
At this step, you must have api_id and api_hash
-
Login to your Telegram account by
/login/main.py
and save automatically your session in/sessions
-
Open
/channel/analysis.ipynb
and run first cell
The most important cell in this notebook is this:
match_case = 0 # Important param
data, dics = cdata(
channel, match_case,
admins=[],
min_id=0, max_id=0,
min_view=0, max_view=0,
min_forward=0, max_forward=0,
min_mention=0, max_mention=0,
start_time='15:00:00', stop_time='21:00:00',
start_datetime=tm.timestamp('2010-01-18 00:00', '%Y-%m-%d %H:%M'),
stop_datetime=tm.timestamp('2010-01-18 00:00', '%Y-%m-%d %H:%M')
According to the following match_case
:
- 0 : No limit
- 1 : DateTime limit
- 2 : TimeRange limit
- 3 : View limit
- 4 : Forward limit
- 5 : Mention limit
- 6 : ID limit
- 7 : Admins
- 12 : DateTime & TimeRange limit
- 13 : DateTime & View limit
- 14 : DateTime & Forward limit
- 15 : DateTime & Mention limit
- 16 : DateTime & ID limit
- 17 : DateTime & Admins
- 23 : TimeRange & View limit
- 24 : TimeRange & Forward limit
- 25 : TimeRange & Mention limit
- 26 : TimeRange & ID limit
- 27 : TimeRange & Admins limit
- 34 : View & Forward limit
- 35 : View & Mention limit
- 36 : View & ID limit
- 37 : View & Admins limit
- 45 : Forward & Mention limit
- 46 : Forward & ID limit
- 47 : Forward & Admins limit
- 56 : Mention & ID limit
- 57 : Mention & Admins limit
- 67 : ID limit & Admins
- 123 : DateTime & TimeRange & View limit
- 124 : DateTime & TimeRange & Forward limit
- 125 : DateTime & TimeRange & Mention limit
- 126 : DateTime & TimeRange & ID limit
- 127 : DateTime & TimeRange & Admins limit
- 234 : TimeRange & View & Forward limit
- 235 : TimeRange & View & Mention limit
- 236 : TimeRange & View & ID limit
- 237 : TimeRange & View & Admins limit
- 345 : View & Forward & Mention limit
- 346 : View & Forward & ID limit
- 347 : View & Forward & Admins limit
- 1234 : DateTime & TimeRange & View & Forward limit
- 1235 : DateTime & TimeRange & View & Mention limit
- 1236 : DateTime & TimeRange & View & ID limit
- 1237 : DateTime & TimeRange & View & Admins limit
- 12345 : DateTime & TimeRange & View & Forward & Mention limit
- 12346 : DateTime & TimeRange & View & Forward & ID limit
- 12347 : DateTime & TimeRange & View & Forward & Admins limit
- 123456 : DateTime & TimeRange & View & Forward & Mention & ID limit
- 123457 : DateTime & TimeRange & View & Forward & Mention & Admins limit
- 1234567 : DateTime & TimeRange & View & Forward & Mention & ID & Admins limit
You can get the data you want in an edited form!