Skip to content
Merged
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
58 changes: 58 additions & 0 deletions .github/workflows/parent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Security Scan

on:
push:
pull_request:

jobs:
security-scan:
name: Security & Quality Check
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Check Python syntax
run: |
python -m py_compile $(find . -name "*.py" -not -path "./.git/*")

- name: Basic security checks
run: |
echo "Checking for potential issues..."

# Check for hardcoded secrets
if grep -r -i -E "(password|secret|key|token)\s*=\s*['\"][^'\"]{8,}" --include="*.py" . ; then
echo "⚠️ Potential hardcoded secrets found!"
exit 1
fi

# Check for dangerous functions
if grep -r -E "(eval|exec)\s*\(" --include="*.py" . ; then
echo "⚠️ Dangerous functions found!"
exit 1
fi

echo "✅ Basic checks passed"

- name: CodeQL Analysis
uses: github/codeql-action/init@v3
with:
languages: python

- name: Run CodeQL
uses: github/codeql-action/analyze@v3
54 changes: 54 additions & 0 deletions utils/download_yt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import os
import sys
import yt_dlp
from pathlib import Path

from yt_dlp import YoutubeDL

class automateDownload:
def __init__(self):
pass

def getUrlsInteractive(self):
urls = []

print("Youtube Video Downloader")
print("Enter Youtube URLs (press Enter on empty line to finish):")

while True:
url = input(f"URL {len(urls) + 1}: ").strip()
if not url:
break
urls.append(url)
return urls

def downloadVideos(self, urls):
ydl_opts = {
'format': 'bestvideo[ext=mp4]/bestvideo',
'merge_output_format': 'mp4',
'outtmpl': 'downloads/%(title)s.%(ext)s',
'ignoreerrors': True
}

with yt_dlp.YoutubeDL(ydl_opts) as ydl:
for url in urls:
try:
print(f"Downloading: {url}")
ydl.download([url])
print(f"Success: {url}")
except Exception as e:
print(f"Failed: {url} - {e}")

def main(self):
urls = self.getUrlsInteractive()

if not urls:
print("No URLS provided!")
sys.exit(1)

print(f"\n Downloading {len(urls)} videos ...")
self.downloadVideos(urls)

if __name__ == "__main__":
downloader = automateDownload()
downloader.main()