Confirmed: Working great. Thanks bluenose.
Side note: The streaming service $killshare uses WILL block you if you go too crazy downloading courses and that is also CONFIRMED.
It was woking perfectly and then a hour video then i blocked. Do I need a VPN? how can i it back working?
WOW fantastic share my friend!!!
Thanks for Sharing! :)
Didn't work for me....
;-(
.
.
.
I updated the code on the site as it wasn't working for me but this revised code works
Code:
import os
import json
import time
import re
from tkinter import filedialog
from tkinter import messagebox
from tkinter import Tk
try:
import requests
except ModuleNotFoundError:
os.system("pip install requests")
import requests
root = Tk()
root.withdraw()
messagebox.showinfo(
"Select txt file", "Please select the txt file generated from hecker.likesyou.org")
file_path = filedialog.askopenfilename()
try:
with open(file_path) as f:
data = json.load(f)
except:
messagebox.showerror("Error", "Please select the generated txt file")
exit()
class_name = re.sub(r'[^\w\s]', '', data['title'])
if not os.path.exists(f"{class_name}"):
os.makedirs(f"{class_name}")
for idx, video in enumerate(data['videos']):
video_name = re.sub(r'[^\w\s]', '', video['name'])
# Create a session
session = requests.Session()
response = session.get(video['link'], stream=True)
content_type = response.headers.get('content-type')
if content_type == "video/mp4":
ext = ".mp4"
elif content_type == "application/x-mpegURL":
ext = ".m3u8"
else:
raise ValueError(f"Unexpected content type: {content_type}")
filename = os.path.join(f"{class_name}", f"{str(idx+1).zfill(3)}_{video_name}{ext}")
if os.path.exists(filename) and os.path.getsize(filename) == int(response.headers.get('Content-Length', 0)):
print(f"\nSkipping {video_name} (already downloaded)")
continue
total_size = int(response.headers.get('content-Length', 0))
block_size = 1024
start_time = time.time()
progress_bar_length = 40
print(f"\nDownloading {video_name} ({idx+1}/{len(data['videos'])})...")
with open(filename, 'wb') as f:
for chunk in response.iter_content(chunk_size=block_size):
if chunk:
f.write(chunk)
f.flush()
downloaded_size = os.path.getsize(filename)
percent_done = int(downloaded_size * 100 / total_size)
download_speed = int(
(downloaded_size / 1024) // max(1, (time.time() - start_time)))
progress_bar = f"[{'=' * int(percent_done / 100 * progress_bar_length)}{' ' * (progress_bar_length - int(percent_done / 100 * progress_bar_length))}]"
print(
f"{progress_bar} {percent_done}% ({download_speed} KB/s)", end='\r')
print(f"\nDownloaded {video_name}")
[/code]
you can generate txt and copy link *.mp4 and use internet download manager
Internet Download Manager is Windows, not for Mac.
I have tried this with substitutes, but too much work and time, now i have taken Unlimited Skillshare from The Goat, a lot easier.
(07-05-2023 12:16 PM)awblackhat Wrote: [ -> ]I updated the code on the site as it wasn't working for me but this revised code works
Code:
import os
import json
import time
import re
from tkinter import filedialog
from tkinter import messagebox
from tkinter import Tk
try:
import requests
except ModuleNotFoundError:
os.system("pip install requests")
import requests
root = Tk()
root.withdraw()
messagebox.showinfo(
"Select txt file", "Please select the txt file generated from hecker.likesyou.org")
file_path = filedialog.askopenfilename()
try:
with open(file_path) as f:
data = json.load(f)
except:
messagebox.showerror("Error", "Please select the generated txt file")
exit()
class_name = re.sub(r'[^\w\s]', '', data['title'])
if not os.path.exists(f"{class_name}"):
os.makedirs(f"{class_name}")
for idx, video in enumerate(data['videos']):
video_name = re.sub(r'[^\w\s]', '', video['name'])
# Create a session
session = requests.Session()
response = session.get(video['link'], stream=True)
content_type = response.headers.get('content-type')
if content_type == "video/mp4":
ext = ".mp4"
elif content_type == "application/x-mpegURL":
ext = ".m3u8"
else:
raise ValueError(f"Unexpected content type: {content_type}")
filename = os.path.join(f"{class_name}", f"{str(idx+1).zfill(3)}_{video_name}{ext}")
if os.path.exists(filename) and os.path.getsize(filename) == int(response.headers.get('Content-Length', 0)):
print(f"\nSkipping {video_name} (already downloaded)")
continue
total_size = int(response.headers.get('content-Length', 0))
block_size = 1024
start_time = time.time()
progress_bar_length = 40
print(f"\nDownloading {video_name} ({idx+1}/{len(data['videos'])})...")
with open(filename, 'wb') as f:
for chunk in response.iter_content(chunk_size=block_size):
if chunk:
f.write(chunk)
f.flush()
downloaded_size = os.path.getsize(filename)
percent_done = int(downloaded_size * 100 / total_size)
download_speed = int(
(downloaded_size / 1024) // max(1, (time.time() - start_time)))
progress_bar = f"[{'=' * int(percent_done / 100 * progress_bar_length)}{' ' * (progress_bar_length - int(percent_done / 100 * progress_bar_length))}]"
print(
f"{progress_bar} {percent_done}% ({download_speed} KB/s)", end='\r')
print(f"\nDownloaded {video_name}")
[/code]
Please how do I use the code?