Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions NoBloatDL/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import yt_dlp
from time import sleep
import shutil
print("Welcome to NoBloatDL!")
print("Made by Notlock")
print("")
print("Loading...")
if not shutil.which("ffmpeg"):
print("ffmpeg is not installed. Download it at https://ffmpeg.org/download.html")
sleep(2)
print("")

## determines file type
def aorv():
q = input("Enter 1 if you want video and audio, or 2 if you want only audio.")
if q == "1":
ext = "mp4"
form = "bestvideo[vcodec^=avc1]+bestaudio/bestvideo+bestaudio/best"
elif q == "2":
ext = "mp3"
form = "bestaudio/best"
ydl_opts["postprocessors"] = [{"key": "FFmpegExtractAudio", "preferredcodec": "mp3"}]
else:
print("You entered an invalid number, please exit the program and run again.")
return ext, form

## download proccess hook
def progress_hook(d):
if d['status'] == 'downloading':
percent = d.get('_percent_str', 'N/A')
eta = d.get('_eta_str', 'N/A')
print(f"\rProgress: {percent} | ETA: {eta}s", end='')
elif d['status'] == 'finished':
print("\nDownload complete!")

while True:
URL = input("Enter video Url: ")
title = input("Enter the name of the output file: ")
ext,form = aorv()
temp = f"{title}.{ext}"
save_dir = input("Enter the directory you would like to save to: ")
# Options dict
ydl_opts = {
"format": form,
"outtmpl": f"{save_dir}/{temp}",
}
if ext == "mp4":
ydl_opts["merge_output_format"] = "mp4"
elif ext == "mp3":
ydl_opts["postprocessors"] = [{"key": "FFmpegExtractAudio", "preferredcodec": "mp3"}]


# download track
ydl_opts["progress_hooks"] = [progress_hook]

# Download
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
ydl.download([URL])

again = input("Download another? (y/n): ")
if again.lower() != "y":
break
5 changes: 5 additions & 0 deletions NoBloatDL/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
this is a little python file I made to download videos from social media platforms, built using YTDLP
mostly because I would rather download locally than use a wesite that could download malware or steal info
I know there's thousands of other media downloaders, but this one is only like a few kilobytes

list of supported sites: https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md
69 changes: 69 additions & 0 deletions Web Browser/Browser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import sys
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import *


class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.tabs = QTabWidget()
self.tabs.setTabsClosable(True)
self.tabs.tabCloseRequested.connect(lambda i: self.tabs.removeTab(i) if self.tabs.count() > 1 else None)
self.setCentralWidget(self.tabs)
self.add_tab()
self.showMaximized()

#navbar
navbar = QToolBar()
self.addToolBar(navbar)

back_button = QAction('Back', self)
back_button.triggered.connect(lambda: self.tabs.currentWidget().back())
navbar.addAction(back_button)

forward_button = QAction('Forward', self)
forward_button.triggered.connect(lambda: self.tabs.currentWidget().forward())
navbar.addAction(forward_button)

reload_button = QAction('Reload', self)
reload_button.triggered.connect(lambda: self.tabs.currentWidget().reload())
navbar.addAction(reload_button)

home_button = QAction('Home', self)
home_button.triggered.connect(self.navigate_home)
navbar.addAction(home_button)

new_tab_btn = QAction('+', self)
new_tab_btn.triggered.connect(lambda: self.add_tab())
navbar.addAction(new_tab_btn)

self.url_bar = QLineEdit()
self.url_bar.returnPressed.connect(self.navigate_to_url)
navbar.addWidget(self.url_bar)

def add_tab(self, url=QUrl("http://duckduckgo.com")):
browser = QWebEngineView()
browser.setUrl(url)
browser.urlChanged.connect(self.update_url)
i = self.tabs.addTab(browser, "New Tab")
self.tabs.setCurrentIndex(i)




def navigate_home(self):
self.tabs.currentWidget().setUrl(QUrl('https://duckduckgo.com'))

def navigate_to_url(self):
url = self.url_bar.text()
self.tabs.currentWidget().setUrl(QUrl(url))

def update_url(self, q):
self.url_bar.setText(q.toString())


app = QApplication(sys.argv)
QApplication.setApplicationName('Chrome = bloat')
window = MainWindow()
app.exec()
3 changes: 3 additions & 0 deletions Web Browser/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Made this based off of a youtube tutorial at https://youtu.be/z-5bZ8EoKu4
(yes I added my own code)
just run it with python and wallah
Loading