Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5235787
commit a7fa7fb
Showing
11 changed files
with
472 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
pre tests/reels/.ipynb_checkpoints/reels-checkpoint.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# https://copyassignment.com/download-instagram-reels-using-python/" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Collecting insta-scrape\n", | ||
" Using cached insta_scrape-2.1.2-py3-none-any.whl (26 kB)\n", | ||
"Requirement already satisfied: beautifulsoup4 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from insta-scrape) (4.9.1)\n", | ||
"Requirement already satisfied: requests in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from insta-scrape) (2.24.0)\n", | ||
"Requirement already satisfied: soupsieve>1.2 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from beautifulsoup4->insta-scrape) (2.0.1)\n", | ||
"Requirement already satisfied: chardet<4,>=3.0.2 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from requests->insta-scrape) (3.0.4)\n", | ||
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from requests->insta-scrape) (1.25.11)\n", | ||
"Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from requests->insta-scrape) (2020.6.20)\n", | ||
"Requirement already satisfied: idna<3,>=2.5 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from requests->insta-scrape) (2.10)\n", | ||
"Installing collected packages: insta-scrape\n", | ||
"Successfully installed insta-scrape-2.1.2\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"!pip3 install insta-scrape" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import time\n", | ||
"\n", | ||
"def download(link):\n", | ||
" try:\n", | ||
" if (link):\n", | ||
"\n", | ||
" SESSIONID = \"18614737527%3ApTLwFoXv5BZohu%3A4\"\n", | ||
" headers = {\n", | ||
" \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.74 Safari/537.36 Edg/79.0.309.43\",\n", | ||
" \"cookie\":f'sessionid={SESSIONID};'\n", | ||
" }\n", | ||
"\n", | ||
" google_reel=Reel(link)\n", | ||
" google_reel.scrape(headers=headers)\n", | ||
" google_reel.download(fp=f\"{int(time.time())}.mp4\")\n", | ||
" else:\n", | ||
" print(\"Empty field\",\"Please fill out the field\")\n", | ||
" except Exception as e:\n", | ||
" print(e)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"download('https://www.instagram.com/p/CThgGVnJIpU/')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# https://copyassignment.com/download-instagram-reels-using-python/" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Collecting insta-scrape\n", | ||
" Using cached insta_scrape-2.1.2-py3-none-any.whl (26 kB)\n", | ||
"Requirement already satisfied: beautifulsoup4 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from insta-scrape) (4.9.1)\n", | ||
"Requirement already satisfied: requests in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from insta-scrape) (2.24.0)\n", | ||
"Requirement already satisfied: soupsieve>1.2 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from beautifulsoup4->insta-scrape) (2.0.1)\n", | ||
"Requirement already satisfied: chardet<4,>=3.0.2 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from requests->insta-scrape) (3.0.4)\n", | ||
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from requests->insta-scrape) (1.25.11)\n", | ||
"Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from requests->insta-scrape) (2020.6.20)\n", | ||
"Requirement already satisfied: idna<3,>=2.5 in c:\\users\\vicky\\anaconda3\\lib\\site-packages (from requests->insta-scrape) (2.10)\n", | ||
"Installing collected packages: insta-scrape\n", | ||
"Successfully installed insta-scrape-2.1.2\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"!pip3 install insta-scrape" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import time\n", | ||
"\n", | ||
"def download(link):\n", | ||
" try:\n", | ||
" if (link):\n", | ||
"\n", | ||
" SESSIONID = \"18614737527%3ApTLwFoXv5BZohu%3A4\"\n", | ||
" headers = {\n", | ||
" \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.74 Safari/537.36 Edg/79.0.309.43\",\n", | ||
" \"cookie\":f'sessionid={SESSIONID};'\n", | ||
" }\n", | ||
"\n", | ||
" google_reel=Reel(link)\n", | ||
" google_reel.scrape(headers=headers)\n", | ||
" google_reel.download(fp=f\"{int(time.time())}.mp4\")\n", | ||
" else:\n", | ||
" print(\"Empty field\",\"Please fill out the field\")\n", | ||
" except Exception as e:\n", | ||
" print(e)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"download('https://www.instagram.com/p/CThgGVnJIpU/')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# pip3 install insta-scrape | ||
# https://copyassignment.com/download-instagram-reels-using-python/ | ||
|
||
from tkinter import * | ||
from PIL import ImageTk, Image | ||
import tkinter.font as font | ||
from tkinter import messagebox | ||
from instascrape import Reel | ||
import time | ||
|
||
root =Tk() | ||
root.title("Instagram Reel Downloader") | ||
root.minsize(600,500) | ||
root.maxsize(600,500) | ||
HEIGHT = 500 | ||
WIDTH = 600 | ||
FONT = font.Font(family ="Times New Roman", size ="18", weight ="bold") | ||
|
||
|
||
def download(link): | ||
try: | ||
if (link): | ||
SESSIONID = "18614737527%3ApTLwFoXv5BZohu%3A4" | ||
headers = { | ||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.74 Safari/537.36 Edg/79.0.309.43", | ||
"cookie":f'sessionid={SESSIONID};' | ||
} | ||
|
||
google_reel=Reel(link) | ||
google_reel.scrape(headers=headers) | ||
google_reel.download(fp=f"reel{int(time.time())}.mp4") | ||
messagebox.showinfo("Status","Reel downloaded successfully") | ||
else: | ||
messagebox.showwarning("Empty field","Please fill out the field") | ||
except Exception as e: | ||
messagebox.showerror("Error","Something went wrong. Please try again later.") | ||
|
||
|
||
canvas = Canvas(root,height = HEIGHT, width = WIDTH) | ||
canvas.pack() | ||
|
||
frame=Frame(root,bg="white") | ||
frame.place(relwidth=1,relheight=1) | ||
|
||
background_image = ImageTk.PhotoImage(Image.open('background.png')) | ||
background_label = Label(frame, image = background_image) | ||
background_label.place(relx=-0.25,relwidth = 0.7, relheight =1) | ||
|
||
|
||
label1 = Label(frame, text = "Download Reels in a Click!", font =FONT, bd =5, fg= "#0d1137",bg="white") | ||
label1.place(relx = 0.48, rely = 0.1, relheight =0.1) | ||
|
||
|
||
|
||
FONT = font.Font(family ="Times New Roman", size ="12", weight ="bold") | ||
label2 = Label(frame, text = "Enter link address: ", font =FONT, bd =5, fg= "#e52165",bg="white") | ||
label2.place(relx = 0.48, rely = 0.25, relheight =0.1) | ||
|
||
entry = Entry(frame, font = FONT, fg = "#fbad50") | ||
entry.place(relx = 0.48, rely = 0.35,relwidth=0.4, relheight = 0.05) | ||
|
||
button1 = Button(root, text = "Download", font = FONT, bg = "pink", fg = "black", activeforeground = "pink", activebackground = "black",command=lambda:download(entry.get())) | ||
button1.place(relx = 0.48,rely = 0.45,relwidth = 0.2, relheight = 0.06) | ||
|
||
label2 = Label(frame, text = "Instructions: ", font =FONT, bd =5, fg= "#0d1137",bg="white") | ||
label2.place(relx = 0.48, rely = 0.6, relheight =0.1) | ||
|
||
FONT = font.Font(family ="Times New Roman", size ="10", weight ="bold") | ||
TEXT="1.Only public account reels can be downloaded\n2.Enter the link address of reel from the Instagram\n3.This is not meant to be used for mischeif" | ||
label2 = Label(frame, text = TEXT, font =FONT, bd =5, fg= "#cd486b",justify=LEFT,bg="white") | ||
label2.place(relx = 0.48, rely = 0.7, relheight =0.1) | ||
|
||
|
||
|
||
root.mainloop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,4 @@ secure-smtplib | |
moviepy==1.0.3 | ||
pandas | ||
pyinstaller | ||
insta-scrape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.