mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2025-02-23 23:04:05 +08:00
instagram download on wg
This commit is contained in:
parent
acc07f760c
commit
320f0d5ffe
4 changed files with 10 additions and 10 deletions
|
@ -21,6 +21,8 @@ longer be available.**
|
|||
|
||||
[https://t.me/benny_ytdlbot](https://t.me/benny_ytdlbot)
|
||||
|
||||
Join Telegram Channel https://t.me/+OGRC8tp9-U9mZDZl for updates.
|
||||
|
||||
Send link directly to the bot. Any
|
||||
Websites [supported by yt-dlp](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) will work t0o.
|
||||
|
||||
|
@ -79,14 +81,14 @@ To deploy this bot, follow these steps:
|
|||
* ```Bash
|
||||
git clone https://github.com/tgbot-collection/ytdlbot
|
||||
```
|
||||
* ```Bash
|
||||
* ```Bash
|
||||
cd ytdlbot/
|
||||
```
|
||||
3. Creating a virtual environment and installing required modules in Python.
|
||||
* ```Python
|
||||
python -m venv venv
|
||||
```
|
||||
* ```Bash
|
||||
* ```Bash
|
||||
source venv/bin/activate # Linux
|
||||
#or
|
||||
.\venv\Scripts\activate # Windows
|
||||
|
@ -94,7 +96,7 @@ To deploy this bot, follow these steps:
|
|||
* ```Python
|
||||
pip install --upgrade pip
|
||||
```
|
||||
* ```Python
|
||||
* ```Python
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
4. Set the environment variables `TOKEN`, `APP_ID`, `APP_HASH`, and any others that you may need.
|
||||
|
|
|
@ -58,6 +58,3 @@ services:
|
|||
- env/ytdl.env
|
||||
restart: always
|
||||
command: [ "/usr/local/bin/python", "/ytdlbot/ytdlbot/instagram.py" ]
|
||||
|
||||
ports:
|
||||
- "127.0.0.1:15000:5000"
|
||||
|
|
|
@ -271,7 +271,10 @@ def split_large_video(video_paths: list):
|
|||
|
||||
|
||||
def download_instagram(url: str, tempdir: str):
|
||||
resp = requests.get(f"https://ytdlbot.dmesg.app/?url={url}").json()
|
||||
if not url.startswith("https://www.instagram.com"):
|
||||
return False
|
||||
|
||||
resp = requests.get(f"http://192.168.6.1:15000/?url={url}").json()
|
||||
if url_results := resp.get("data"):
|
||||
for link in url_results:
|
||||
content = requests.get(link, stream=True).content
|
||||
|
|
|
@ -19,8 +19,6 @@ app = Flask(__name__)
|
|||
@app.route("/")
|
||||
def index():
|
||||
url = request.args.get("url")
|
||||
if not url.startswith("https://www.instagram.com"):
|
||||
return {}
|
||||
|
||||
logging.info("Requesting instagram download link for %s", url)
|
||||
cookies = {"sessionid": INSTAGRAM_SESSION}
|
||||
|
@ -65,4 +63,4 @@ def index():
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=False, host="0.0.0.0")
|
||||
app.run(host="0.0.0.0", port=80)
|
||||
|
|
Loading…
Reference in a new issue