RIZER 1.0.0__tar.gz → 1.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. rizer-1.4.0/LICENSE +21 -0
  2. rizer-1.4.0/MANIFEST.in +16 -0
  3. rizer-1.4.0/PKG-INFO +232 -0
  4. rizer-1.4.0/README.md +173 -0
  5. rizer-1.4.0/RIZER/APIS/__init__.py +1 -0
  6. rizer-1.4.0/RIZER/APIS/insta.py +140 -0
  7. rizer-1.4.0/RIZER/Pb2/DEcwHisPErMsG_pb2.py +42 -0
  8. rizer-1.4.0/RIZER/Pb2/Fo_pb2.py +28 -0
  9. rizer-1.4.0/RIZER/Pb2/GenWhisperMsg_pb2.py +48 -0
  10. rizer-1.4.0/RIZER/Pb2/MajoRLoGinrEq_pb2.py +28 -0
  11. rizer-1.4.0/RIZER/Pb2/MajoRLoGinrEs_pb2.py +36 -0
  12. rizer-1.4.0/RIZER/Pb2/PorTs_pb2.py +36 -0
  13. rizer-1.4.0/RIZER/Pb2/Team_msg_pb2.py +48 -0
  14. rizer-1.4.0/RIZER/Pb2/__init__.py +1 -0
  15. rizer-1.4.0/RIZER/Pb2/sQ_pb2.py +38 -0
  16. rizer-1.4.0/RIZER/accounts.json +7 -0
  17. rizer-1.4.0/RIZER/build/lib/APIS/__init__.py +1 -0
  18. rizer-1.4.0/RIZER/build/lib/APIS/insta.py +140 -0
  19. rizer-1.4.0/RIZER/build/lib/Pb2/DEcwHisPErMsG_pb2.py +42 -0
  20. rizer-1.4.0/RIZER/build/lib/Pb2/Fo_pb2.py +28 -0
  21. rizer-1.4.0/RIZER/build/lib/Pb2/GenWhisperMsg_pb2.py +48 -0
  22. rizer-1.4.0/RIZER/build/lib/Pb2/MajoRLoGinrEq_pb2.py +28 -0
  23. rizer-1.4.0/RIZER/build/lib/Pb2/MajoRLoGinrEs_pb2.py +36 -0
  24. rizer-1.4.0/RIZER/build/lib/Pb2/PorTs_pb2.py +36 -0
  25. rizer-1.4.0/RIZER/build/lib/Pb2/Team_msg_pb2.py +48 -0
  26. rizer-1.4.0/RIZER/build/lib/Pb2/__init__.py +1 -0
  27. rizer-1.4.0/RIZER/build/lib/Pb2/sQ_pb2.py +38 -0
  28. rizer-1.4.0/RIZER/main.py +6377 -0
  29. rizer-1.4.0/RIZER/requirements.txt +16 -0
  30. rizer-1.4.0/RIZER/rizer_runner.py +263 -0
  31. rizer-1.4.0/RIZER/setup.py +93 -0
  32. rizer-1.4.0/RIZER/tests/__init__.py +1 -0
  33. rizer-1.4.0/RIZER/tests/test_runner.py +90 -0
  34. rizer-1.4.0/RIZER/xC4.py +499 -0
  35. rizer-1.4.0/RIZER/xHeaders.py +224 -0
  36. rizer-1.4.0/RIZER/xKEys.py +31 -0
  37. rizer-1.4.0/RIZER.egg-info/PKG-INFO +232 -0
  38. rizer-1.4.0/RIZER.egg-info/SOURCES.txt +46 -0
  39. rizer-1.4.0/RIZER.egg-info/entry_points.txt +2 -0
  40. rizer-1.4.0/RIZER.egg-info/requires.txt +4 -0
  41. rizer-1.4.0/RIZER.egg-info/top_level.txt +1 -0
  42. rizer-1.4.0/pyproject.toml +67 -0
  43. rizer-1.4.0/setup.py +93 -0
  44. rizer-1.4.0/tests/test_runner.py +90 -0
  45. rizer-1.0.0/MANIFEST.in +0 -1
  46. rizer-1.0.0/PKG-INFO +0 -3
  47. rizer-1.0.0/RIZER.egg-info/PKG-INFO +0 -3
  48. rizer-1.0.0/RIZER.egg-info/SOURCES.txt +0 -8
  49. rizer-1.0.0/RIZER.egg-info/entry_points.txt +0 -2
  50. rizer-1.0.0/pyproject.toml +0 -3
  51. rizer-1.0.0/setup.py +0 -14
  52. {rizer-1.0.0 → rizer-1.4.0}/RIZER.egg-info/dependency_links.txt +0 -0
  53. /rizer-1.0.0/RIZER.egg-info/top_level.txt → /rizer-1.4.0/RIZER.egg-info/not-zip-safe +0 -0
  54. {rizer-1.0.0 → rizer-1.4.0}/setup.cfg +0 -0
rizer-1.4.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 RIZER Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,16 @@
1
+ # Include all necessary files
2
+ include RIZER/main.py
3
+ include RIZER/xC4.py
4
+ include RIZER/xHeaders.py
5
+ include RIZER/xKEYs.py
6
+ include RIZER/accounts.json
7
+ include RIZER/requirements.txt
8
+
9
+ # Include all files in APIS and Pb2 directories
10
+ recursive-include RIZER/APIS *
11
+ recursive-include RIZER/Pb2 *
12
+
13
+ # Exclude unnecessary files
14
+ global-exclude *.pyc
15
+ global-exclude __pycache__
16
+ global-exclude .DS_Store
rizer-1.4.0/PKG-INFO ADDED
@@ -0,0 +1,232 @@
1
+ Metadata-Version: 2.4
2
+ Name: RIZER
3
+ Version: 1.4.0
4
+ Summary: Free Fire Automation Tool with Terminal Launcher
5
+ Home-page: https://github.com/rizer/tool
6
+ Author: RIZER Team
7
+ Author-email: RIZER Team <support@rizer.tool>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2024 RIZER Team
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Project-URL: Homepage, https://github.com/rizer/tool
31
+ Project-URL: Repository, https://github.com/rizer/tool
32
+ Project-URL: Issues, https://github.com/rizer/tool/issues
33
+ Project-URL: Documentation, https://github.com/rizer/tool/wiki
34
+ Keywords: free fire,automation,gaming,tool,cli
35
+ Classifier: Development Status :: 4 - Beta
36
+ Classifier: Intended Audience :: End Users/Desktop
37
+ Classifier: License :: OSI Approved :: MIT License
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.7
40
+ Classifier: Programming Language :: Python :: 3.8
41
+ Classifier: Programming Language :: Python :: 3.9
42
+ Classifier: Programming Language :: Python :: 3.10
43
+ Classifier: Programming Language :: Python :: 3.11
44
+ Classifier: Programming Language :: Python :: 3.12
45
+ Classifier: Operating System :: OS Independent
46
+ Classifier: Environment :: Console
47
+ Classifier: Topic :: Utilities
48
+ Requires-Python: >=3.7
49
+ Description-Content-Type: text/markdown
50
+ License-File: LICENSE
51
+ Requires-Dist: requests>=2.25.0
52
+ Requires-Dist: protobuf>=3.19.0
53
+ Requires-Dist: colorama>=0.4.4
54
+ Requires-Dist: pycryptodome>=3.15.0
55
+ Dynamic: author
56
+ Dynamic: home-page
57
+ Dynamic: license-file
58
+ Dynamic: requires-python
59
+
60
+ # RIZER
61
+
62
+ Free Fire Automation Tool with Terminal Launcher
63
+
64
+ ## 📁 Package Structure
65
+
66
+ ```
67
+ RIZER/
68
+ ├── RIZER/
69
+ │ ├── __init__.py
70
+ │ ├── rizer_runner.py # Main launcher
71
+ │ ├── main.py # Your main.py (untouched except UID/PW line)
72
+ │ ├── xC4.py
73
+ │ ├── xHeaders.py
74
+ │ ├── xKEYs.py
75
+ │ ├── accounts.json
76
+ │ ├── APIS/ # API modules
77
+ │ └── Pb2/ # Protobuf modules
78
+ ├── setup.py # PyPI build config
79
+ ├── MANIFEST.in # Package manifest
80
+ ├── requirements.txt # Dependencies
81
+ └── README.md # This file
82
+ ```
83
+
84
+ ## 🚀 Features
85
+
86
+ - ✅ **main.py untouched** - Only UID/Password line modified (~line 6272)
87
+ - ✅ **Password visible** during input (no masking)
88
+ - ✅ **ASCII + Color** logo at startup
89
+ - ✅ **Clean terminal** - Old text cleared, only logo + prompts visible
90
+ - ✅ **Logs preserved** - main.py logs unchanged
91
+ - ✅ **Ctrl+C safe exit** - Clean shutdown message
92
+ - ✅ **Relative imports fixed** - APIS/ and Pb2/ auto-load
93
+ - ✅ **Multi-user support** - Each input isolated
94
+ - ✅ **PyPI ready** - Easy install and upgrade
95
+
96
+ ## 📦 Build & Install
97
+
98
+ ### 1. Prepare Your Files
99
+
100
+ Replace the placeholder files with your actual files:
101
+
102
+ ```bash
103
+ # Copy your actual main.py (must contain: Uid , Pw = 'uiddd','passwordd')
104
+ cp /path/to/your/main.py RIZER/RIZER/main.py
105
+
106
+ # Copy other required files
107
+ cp /path/to/your/xC4.py RIZER/RIZER/
108
+ cp /path/to/your/xHeaders.py RIZER/RIZER/
109
+ cp /path/to/your/xKEYs.py RIZER/RIZER/
110
+ cp /path/to/your/accounts.json RIZER/RIZER/
111
+
112
+ # Copy directories
113
+ cp -r /path/to/your/APIS/* RIZER/RIZER/APIS/
114
+ cp -r /path/to/your/Pb2/* RIZER/RIZER/Pb2/
115
+ ```
116
+
117
+ ### 2. Build Package
118
+
119
+ ```bash
120
+ cd RIZER
121
+
122
+ # Install build tools
123
+ pip install setuptools wheel twine
124
+
125
+ # Build package
126
+ python setup.py sdist bdist_wheel
127
+ ```
128
+
129
+ ### 3. Upload to PyPI
130
+
131
+ ```bash
132
+ # Upload to PyPI (requires account)
133
+ twine upload dist/*
134
+
135
+ # Or upload to Test PyPI first
136
+ twine upload --repository testpypi dist/*
137
+ ```
138
+
139
+ ### 4. Install & Use
140
+
141
+ ```bash
142
+ # Install from PyPI
143
+ pip install RIZER
144
+
145
+ # Or upgrade
146
+ pip install --upgrade RIZER
147
+
148
+ # Run
149
+ RIZER
150
+ ```
151
+
152
+ ## 🖥️ Usage
153
+
154
+ After installation, simply type in terminal:
155
+
156
+ ```bash
157
+ RIZER
158
+ ```
159
+
160
+ You will see:
161
+
162
+ ```
163
+ ██████╗░██╗███████╗███████╗██████╗░
164
+ ██╔══██╗██║╚════██║██╔════╝██╔══██╗
165
+ ██████╔╝██║░░███╔═╝█████╗░░██████╔╝
166
+ ██╔══██╗██║██╔══╝░░██╔══╝░░██╔══██╗
167
+ ██║░░██║██║███████╗███████╗██║░░██║
168
+ ╚═╝░░╚═╝╚═╝╚══════╝╚══════╝╚═╝░░╚═╝
169
+ RIZER v1.4.0
170
+ Free Fire Automation Tool
171
+
172
+ ╔════════════════════════════════════╗
173
+ ║ Account Configuration ║
174
+ ╚════════════════════════════════════╝
175
+
176
+ Enter UID: 12345678
177
+ Enter Password: yourpassword
178
+
179
+ ⚙️ Updating credentials...
180
+ ✅ Credentials updated successfully!
181
+
182
+ 🚀 Launching main.py...
183
+
184
+ [main.py output appears here...]
185
+ ```
186
+
187
+ ## ⚙️ How It Works
188
+
189
+ 1. **Clear Screen** - Terminal cleared for clean look
190
+ 2. **ASCII Logo** - Colorful RIZER logo displayed
191
+ 3. **Input Prompts** - UID and Password entered (visible)
192
+ 4. **Pattern Match** - Finds line: `Uid , Pw = 'uiddd','passwordd'`
193
+ 5. **Replace** - Updates with user input, preserves formatting
194
+ 6. **Execute** - Runs main.py with new credentials
195
+ 7. **Reset** - Restores default values after execution
196
+
197
+ ## 🛡️ Safety Features
198
+
199
+ - **No permanent changes** - main.py reset after each run
200
+ - **Keyboard interrupt handling** - Safe Ctrl+C exit
201
+ - **Missing file warnings** - Continues even if files missing
202
+ - **Error handling** - Graceful failures with messages
203
+
204
+ ## 📝 Notes
205
+
206
+ - main.py must contain the exact pattern: `Uid , Pw = 'uiddd','passwordd'`
207
+ - Single quotes preferred but double quotes also supported
208
+ - All other lines in main.py remain untouched
209
+ - Each user runs with their own credentials
210
+ - Logs from main.py displayed in real-time
211
+
212
+ ## 🔧 Troubleshooting
213
+
214
+ **Import errors?**
215
+ - rizer_runner.py automatically fixes Python path
216
+ - APIS/ and Pb2/ added to sys.path
217
+
218
+ **main.py not found?**
219
+ - Ensure main.py is in the same directory as rizer_runner.py
220
+ - Check file permissions
221
+
222
+ **Pattern not found?**
223
+ - Verify main.py contains: `Uid , Pw = 'uiddd','passwordd'`
224
+ - Check for extra spaces or different quote types
225
+
226
+ ## 📄 License
227
+
228
+ MIT License - See LICENSE file
229
+
230
+ ## 🤝 Support
231
+
232
+ For support, contact: support@rizer.tool
rizer-1.4.0/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # RIZER
2
+
3
+ Free Fire Automation Tool with Terminal Launcher
4
+
5
+ ## 📁 Package Structure
6
+
7
+ ```
8
+ RIZER/
9
+ ├── RIZER/
10
+ │ ├── __init__.py
11
+ │ ├── rizer_runner.py # Main launcher
12
+ │ ├── main.py # Your main.py (untouched except UID/PW line)
13
+ │ ├── xC4.py
14
+ │ ├── xHeaders.py
15
+ │ ├── xKEYs.py
16
+ │ ├── accounts.json
17
+ │ ├── APIS/ # API modules
18
+ │ └── Pb2/ # Protobuf modules
19
+ ├── setup.py # PyPI build config
20
+ ├── MANIFEST.in # Package manifest
21
+ ├── requirements.txt # Dependencies
22
+ └── README.md # This file
23
+ ```
24
+
25
+ ## 🚀 Features
26
+
27
+ - ✅ **main.py untouched** - Only UID/Password line modified (~line 6272)
28
+ - ✅ **Password visible** during input (no masking)
29
+ - ✅ **ASCII + Color** logo at startup
30
+ - ✅ **Clean terminal** - Old text cleared, only logo + prompts visible
31
+ - ✅ **Logs preserved** - main.py logs unchanged
32
+ - ✅ **Ctrl+C safe exit** - Clean shutdown message
33
+ - ✅ **Relative imports fixed** - APIS/ and Pb2/ auto-load
34
+ - ✅ **Multi-user support** - Each input isolated
35
+ - ✅ **PyPI ready** - Easy install and upgrade
36
+
37
+ ## 📦 Build & Install
38
+
39
+ ### 1. Prepare Your Files
40
+
41
+ Replace the placeholder files with your actual files:
42
+
43
+ ```bash
44
+ # Copy your actual main.py (must contain: Uid , Pw = 'uiddd','passwordd')
45
+ cp /path/to/your/main.py RIZER/RIZER/main.py
46
+
47
+ # Copy other required files
48
+ cp /path/to/your/xC4.py RIZER/RIZER/
49
+ cp /path/to/your/xHeaders.py RIZER/RIZER/
50
+ cp /path/to/your/xKEYs.py RIZER/RIZER/
51
+ cp /path/to/your/accounts.json RIZER/RIZER/
52
+
53
+ # Copy directories
54
+ cp -r /path/to/your/APIS/* RIZER/RIZER/APIS/
55
+ cp -r /path/to/your/Pb2/* RIZER/RIZER/Pb2/
56
+ ```
57
+
58
+ ### 2. Build Package
59
+
60
+ ```bash
61
+ cd RIZER
62
+
63
+ # Install build tools
64
+ pip install setuptools wheel twine
65
+
66
+ # Build package
67
+ python setup.py sdist bdist_wheel
68
+ ```
69
+
70
+ ### 3. Upload to PyPI
71
+
72
+ ```bash
73
+ # Upload to PyPI (requires account)
74
+ twine upload dist/*
75
+
76
+ # Or upload to Test PyPI first
77
+ twine upload --repository testpypi dist/*
78
+ ```
79
+
80
+ ### 4. Install & Use
81
+
82
+ ```bash
83
+ # Install from PyPI
84
+ pip install RIZER
85
+
86
+ # Or upgrade
87
+ pip install --upgrade RIZER
88
+
89
+ # Run
90
+ RIZER
91
+ ```
92
+
93
+ ## 🖥️ Usage
94
+
95
+ After installation, simply type in terminal:
96
+
97
+ ```bash
98
+ RIZER
99
+ ```
100
+
101
+ You will see:
102
+
103
+ ```
104
+ ██████╗░██╗███████╗███████╗██████╗░
105
+ ██╔══██╗██║╚════██║██╔════╝██╔══██╗
106
+ ██████╔╝██║░░███╔═╝█████╗░░██████╔╝
107
+ ██╔══██╗██║██╔══╝░░██╔══╝░░██╔══██╗
108
+ ██║░░██║██║███████╗███████╗██║░░██║
109
+ ╚═╝░░╚═╝╚═╝╚══════╝╚══════╝╚═╝░░╚═╝
110
+ RIZER v1.4.0
111
+ Free Fire Automation Tool
112
+
113
+ ╔════════════════════════════════════╗
114
+ ║ Account Configuration ║
115
+ ╚════════════════════════════════════╝
116
+
117
+ Enter UID: 12345678
118
+ Enter Password: yourpassword
119
+
120
+ ⚙️ Updating credentials...
121
+ ✅ Credentials updated successfully!
122
+
123
+ 🚀 Launching main.py...
124
+
125
+ [main.py output appears here...]
126
+ ```
127
+
128
+ ## ⚙️ How It Works
129
+
130
+ 1. **Clear Screen** - Terminal cleared for clean look
131
+ 2. **ASCII Logo** - Colorful RIZER logo displayed
132
+ 3. **Input Prompts** - UID and Password entered (visible)
133
+ 4. **Pattern Match** - Finds line: `Uid , Pw = 'uiddd','passwordd'`
134
+ 5. **Replace** - Updates with user input, preserves formatting
135
+ 6. **Execute** - Runs main.py with new credentials
136
+ 7. **Reset** - Restores default values after execution
137
+
138
+ ## 🛡️ Safety Features
139
+
140
+ - **No permanent changes** - main.py reset after each run
141
+ - **Keyboard interrupt handling** - Safe Ctrl+C exit
142
+ - **Missing file warnings** - Continues even if files missing
143
+ - **Error handling** - Graceful failures with messages
144
+
145
+ ## 📝 Notes
146
+
147
+ - main.py must contain the exact pattern: `Uid , Pw = 'uiddd','passwordd'`
148
+ - Single quotes preferred but double quotes also supported
149
+ - All other lines in main.py remain untouched
150
+ - Each user runs with their own credentials
151
+ - Logs from main.py displayed in real-time
152
+
153
+ ## 🔧 Troubleshooting
154
+
155
+ **Import errors?**
156
+ - rizer_runner.py automatically fixes Python path
157
+ - APIS/ and Pb2/ added to sys.path
158
+
159
+ **main.py not found?**
160
+ - Ensure main.py is in the same directory as rizer_runner.py
161
+ - Check file permissions
162
+
163
+ **Pattern not found?**
164
+ - Verify main.py contains: `Uid , Pw = 'uiddd','passwordd'`
165
+ - Check for extra spaces or different quote types
166
+
167
+ ## 📄 License
168
+
169
+ MIT License - See LICENSE file
170
+
171
+ ## 🤝 Support
172
+
173
+ For support, contact: support@rizer.tool
@@ -0,0 +1 @@
1
+ # Auto __init__.py created
@@ -0,0 +1,140 @@
1
+ # ------------------------------------------------------------
2
+ # Instagram Info API — Credit: Anmol (@FOREVER_HIDDEN)
3
+ # JOIN : @SOURCE_SUTRA FOR MORE SRC | API | BOT CODE | METHOD | 🛐
4
+ # Purpose : Fetch profile & recent media (public + optional session-based)
5
+ # Note : THIS CODE MADE BY ANMOL @FOREVER_HIDDEN (GIVE CREDIT OTHERWISE EVERYONE FUCK YOU AT 300 KM SPEED)
6
+ # Usage : /api/insta/<username>?
7
+ # License : Personal / internal use only — retain credit when sharing
8
+ # ------------------------------------------------------------
9
+
10
+ from flask import Flask, jsonify, request
11
+ import requests
12
+ import time
13
+ import socket
14
+ from functools import lru_cache
15
+
16
+ app = Flask(__name__)
17
+
18
+ # DONT REMOVE THIS BRUH
19
+ @lru_cache(maxsize=1024)
20
+ def fetch_instagram_profile(username, proxy=None):
21
+ url = f"https://i.instagram.com/api/v1/users/web_profile_info/?username={username}"
22
+ headers = {
23
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
24
+ "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
25
+ "Accept": "application/json, text/plain, */*",
26
+ "x-ig-app-id": "936619743392459",
27
+ "Referer": f"https://www.instagram.com/{username}/",
28
+ }
29
+ session = requests.Session()
30
+ proxies = {"http": proxy, "https": proxy} if proxy else None
31
+
32
+ backoff = 1
33
+ for attempt in range(4):
34
+ try:
35
+ resp = session.get(url, headers=headers, timeout=10, proxies=proxies)
36
+ if resp.status_code == 200:
37
+ return resp.json()
38
+ elif resp.status_code in (429, 403):
39
+ # rate limited or blocked
40
+ time.sleep(backoff)
41
+ backoff *= 2
42
+ elif resp.status_code == 404:
43
+ return {"error": "not_found", "status_code": 404}
44
+ else:
45
+ return {
46
+ "error": "http_error",
47
+ "status_code": resp.status_code,
48
+ "body": resp.text[:500],
49
+ }
50
+ except requests.RequestException:
51
+ time.sleep(backoff)
52
+ backoff *= 2
53
+ return {"error": "request_failed"}
54
+
55
+
56
+ @app.route("/api/insta/<username>", methods=["GET"])
57
+ def insta_info(username):
58
+ proxy = request.args.get("proxy") # optional proxy
59
+ data = fetch_instagram_profile(username, proxy=proxy)
60
+ if data is None:
61
+ return jsonify({"error": "no_response"}), 502
62
+
63
+ if "error" in data:
64
+ return jsonify(data), (data.get("status_code") or 400)
65
+
66
+ try:
67
+ user = data.get("data", {}).get("user") or data.get("user") or data.get("data")
68
+ if not user:
69
+ return jsonify({"raw": data})
70
+
71
+ out = {
72
+ "id": user.get("id"),
73
+ "username": user.get("username"),
74
+ "full_name": user.get("full_name"),
75
+ "biography": user.get("biography"),
76
+ "is_private": user.get("is_private"),
77
+ "is_verified": user.get("is_verified"),
78
+ "profile_pic_url": user.get("profile_pic_url_hd")
79
+ or user.get("profile_pic_url"),
80
+ "followers_count": (
81
+ user.get("edge_followed_by", {}).get("count")
82
+ or user.get("followers_count")
83
+ ),
84
+ "following_count": (
85
+ user.get("edge_follow", {}).get("count")
86
+ or user.get("following_count")
87
+ ),
88
+ "media_count": (
89
+ user.get("media_count")
90
+ or user.get("edge_owner_to_timeline_media", {}).get("count")
91
+ ),
92
+ "recent_media": [],
93
+ }
94
+
95
+ media = (
96
+ user.get("edge_owner_to_timeline_media")
97
+ or user.get("media")
98
+ or {}
99
+ )
100
+ edges = media.get("edges") or media.get("items") or []
101
+ for e in edges[:8]:
102
+ node = e.get("node") if isinstance(e, dict) and e.get("node") else e
103
+ if not node:
104
+ continue
105
+ caption = None
106
+ if node.get("edge_media_to_caption"):
107
+ edges_caption = node["edge_media_to_caption"].get("edges") or []
108
+ if edges_caption and "node" in edges_caption[0]:
109
+ caption = edges_caption[0]["node"].get("text")
110
+ else:
111
+ caption = node.get("caption")
112
+
113
+ out["recent_media"].append({
114
+ "id": node.get("id"),
115
+ "shortcode": node.get("shortcode"),
116
+ "display_url": node.get("display_url")
117
+ or node.get("display_src"),
118
+ "taken_at": node.get("taken_at_timestamp")
119
+ or node.get("taken_at"),
120
+ "caption": caption,
121
+ })
122
+ return jsonify(out)
123
+ except Exception as exc:
124
+ return jsonify({
125
+ "error": "parse_error",
126
+ "details": str(exc),
127
+ "raw": data
128
+ }), 500
129
+
130
+ def find_free_port(start=8080, end=65535):
131
+ for port in range(start, end):
132
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
133
+ if s.connect_ex(('0.0.0.0', port)) != 0:
134
+ return port
135
+ raise RuntimeError("No free port available")
136
+
137
+ if __name__ == "__main__":
138
+ port = find_free_port()
139
+ print(f"Starting server on port {port}")
140
+ app.run(host="0.0.0.0", port=port, debug=False)
@@ -0,0 +1,42 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: DecodeWhisperMsg.proto
5
+ # Protobuf Python Version: 6.30.0
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 30,
16
+ 0,
17
+ '',
18
+ 'DecodeWhisperMsg.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x44\x65\x63odeWhisperMsg.proto\"\xa8\x02\n\rDecodeWhisper\x12$\n\x04\x44\x61ta\x18\x05 \x01(\x0b\x32\x16.DecodeWhisper.Nested1\x1a\xf0\x01\n\x07Nested1\x12\x0b\n\x03uid\x18\x01 \x01(\x04\x12\x0f\n\x07\x43hat_ID\x18\x02 \x01(\x04\x12\x11\n\tchat_type\x18\x03 \x01(\x05\x12\x0b\n\x03msg\x18\x04 \x01(\t\x12/\n\x07\x44\x65tails\x18\t \x01(\x0b\x32\x1e.DecodeWhisper.Nested1.Nested2\x12\x35\n\rPlatform_Info\x18\r \x01(\x0b\x32\x1e.DecodeWhisper.Nested1.Nested3\x1a\x1b\n\x07Nested2\x12\x10\n\x08Nickname\x18\x01 \x01(\t\x1a\"\n\x07Nested3\x12\x17\n\x0fprofile_pic_url\x18\x01 \x01(\tb\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'DecodeWhisperMsg_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_DECODEWHISPER']._serialized_start=27
35
+ _globals['_DECODEWHISPER']._serialized_end=323
36
+ _globals['_DECODEWHISPER_NESTED1']._serialized_start=83
37
+ _globals['_DECODEWHISPER_NESTED1']._serialized_end=323
38
+ _globals['_DECODEWHISPER_NESTED1_NESTED2']._serialized_start=260
39
+ _globals['_DECODEWHISPER_NESTED1_NESTED2']._serialized_end=287
40
+ _globals['_DECODEWHISPER_NESTED1_NESTED3']._serialized_start=289
41
+ _globals['_DECODEWHISPER_NESTED1_NESTED3']._serialized_end=323
42
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,28 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: Friends.proto
4
+ # Protobuf Python Version: 4.25.1
5
+ """Generated protocol buffer code."""
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
10
+ # @@protoc_insertion_point(imports)
11
+
12
+ _sym_db = _symbol_database.Default()
13
+
14
+
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rFriends.proto\"\"\n\x06\x46riend\x12\n\n\x02ID\x18\x01 \x01(\x03\x12\x0c\n\x04Name\x18\x03 \x01(\t\"#\n\x07\x46riends\x12\x18\n\x07\x66ield_1\x18\x01 \x03(\x0b\x32\x07.Friendb\x06proto3')
18
+
19
+ _globals = globals()
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'Friends_pb2', _globals)
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+ DESCRIPTOR._options = None
24
+ _globals['_FRIEND']._serialized_start=17
25
+ _globals['_FRIEND']._serialized_end=51
26
+ _globals['_FRIENDS']._serialized_start=53
27
+ _globals['_FRIENDS']._serialized_end=88
28
+ # @@protoc_insertion_point(module_scope)