Thursday, 8 May 2025

Youtube Video Downloader API

 

-----------------------------------------------------------------------------------------------------------------------------
READ MORE
https://cupidsnaps.blogspot.com/2025/05/youtube-video-download.html
https://github.com/Ali-Raza764/Downloadib/tree/main
https://github.com/gregthehacker/All-in-One-Php-Video-Downloader-by-itsMeTheVKr
https://www.wikihow.com/Make-an-Exe-File
FREE YOUTUBE COPY RIGHT CHANNLE
https://www.youtube.com/c/FreeHDvideosnocopyright
https://www.youtube.com/shorts/n6jlA7UqpAM
https://www.youtube.com/shorts/aI1GCa_65rY
------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Downloadib</title>
<style>
body {
font-family: Arial,sans-serif;
margin:0; padding-bottom:60px;
background:#f4f4f4; color:#333;
min-height:100vh; box-sizing:border-box; position:relative;
}
.logo{text-align:center;margin:20px 0;}
.logo img{max-width:200px;height:auto;}
form{display:flex;justify-content:center;margin:0 0 20px;padding:0 15px;}
.bar {
display:flex;align-items:center;
background:#fff; border-radius:30px;
padding:5px 15px; max-width:500px; width:100%;
box-shadow:0 2px 5px rgba(0,0,0,0.1);
}
input {
flex:1; border:none; outline:none;
padding:10px; font-size:16px;
border-radius:30px;
}
button {
background:none; border:none; cursor:pointer;
padding:5px 10px;
}
.container {
text-align:center; padding:20px;
display:flex; flex-wrap:wrap;
justify-content:center; gap:20px;
}
.item {
background:#fff; border-radius:8px;
padding:15px; box-shadow:0 2px 5px rgba(0,0,0,0.1);
max-width:300px; text-align:left; width:100%;
}
img.thumbnail {
width:100%; border-radius:5px;
margin-bottom:10px; max-height:180px; object-fit:cover;
}
.action {
display:flex; justify-content:space-between;
align-items:center; margin-bottom:10px;
}
.video-resolution {
color:#666; font-size:14px; margin-right:10px;
}
.download-btn {
background:#f00; color:#fff;
border:none; padding:8px 15px;
border-radius:4px; cursor:pointer;
font-weight:bold; text-decoration:none;
font-size:14px; display:flex; align-items:center; gap:8px;
}
.link-box {
width: 100%;
height: 150px;
padding: 12px 20px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
background-color: #f8f8f8;
font-size: 16px;
resize: none;
}
.copy-message {
color:green; font-size:12px;
margin-top:5px; display:none;
}
footer {
background:#222; color:#fff;
padding:10px 0; position:absolute;
width:100%; bottom:0; text-align:center;
}
@media (max-width:490px) {
input {font-size:14px;}
.bar {padding:8px 15px;}
.item {max-width:100%;}
}
</style>
</head>
<body>
<div class="logo">
<img src="https://cdn-icons-png.flaticon.com/512/1384/1384060.png" alt="Downloadib" />
</div>
<form id="form">
<div class="bar">
<input id="search" type="text" placeholder="Enter YouTube video link here" required />
<button type="submit" aria-label="Search">
<img src="https://cdn-icons-png.flaticon.com/512/149/149852.png" alt="Search" style="width:24px;height:24px" />
</button>
</div>
</form>
<div class="container">
<h3>Your Videos Will Appear Here!</h3>
</div>
<footer>
<h4>&copy; CodeWithAli all rights reserved</h4>
</footer>

<script>
document.getElementById('form').onsubmit = async function(e) {
e.preventDefault();
const input = document.getElementById('search').value.trim();
if (!input) return alert('Please enter a YouTube URL');

let id = '';
if(input.includes('watch?v=')) id = input.split('watch?v=')[1].split('&')[0];
else if(input.includes('youtu.be/')) id = input.split('youtu.be/')[1].split('?')[0];
else id = input.split('/').pop();

const container = document.querySelector('.container');
container.innerHTML = '<h3>Loading...</h3>';

try {
const res = await fetch(`https://ytstream-download-youtube-videos.p.rapidapi.com/dl?id=${id}`, {
method:'GET',
headers: {
'X-RapidAPI-Key':'d40c265118mshdc90194a533aa99p18842bjsn18247c206e8e',
'X-RapidAPI-Host':'ytstream-download-youtube-videos.p.rapidapi.com'
}
});
const data = await res.json();

if (!data.formats || !data.formats.length) {
container.innerHTML = '<h3>No download options found for this video</h3>';
return;
}

container.innerHTML = `<h2 style="width:100%;text-align:center;margin-bottom:20px">${data.title}</h2>
<img src="${data.thumbnail?.slice(-1)[0]?.url || ''}" class="thumbnail" alt="Thumbnail" style="max-width:500px;margin:0 auto;display:block;margin-bottom:20px" />`;

data.formats.forEach(f => {
const item = document.createElement('div');
item.className = 'item';

item.innerHTML = `
<div class="action">
<span class="video-resolution">${f.qualityLabel || 'Unknown'}</span>
<a href="${f.url}" download="${data.title} - ${f.qualityLabel || 'video'}.mp4" class="download-btn" target="_blank" rel="noopener noreferrer">
Download
<img src="https://cdn-icons-png.flaticon.com/512/724/724933.png" alt="Download" class="download-icon" style="width:18px;height:18px"/>
</a>
</div>
<textarea class="link-box" readonly onclick="this.select();navigator.clipboard.writeText(this.value);" title="Click to copy link">${f.url}</textarea>
`;

container.appendChild(item);
});
} catch (err) {
container.innerHTML = '<h3>Error processing your request. Please check the URL and try again.</h3>';
console.error(err);
}
};
</script>
</body>
</html>
------------------------------------------------------------------------------------------------------------------------
I DOWNLOADED PYTHON 64 BIT AND MAKE A PYTHON FILE IN SAME FOLDER
------------------------------------------------------------------------------------------------------------------------

🎒 مرحلہ وار طریقہ (بچوں کے لیے آسان انداز میں)

✅ 1. Python انسٹال کریں

اگر آپ کے پاس Python نہیں ہے تو پہلے python.org سے Python انسٹال کریں۔


✅ 2. yt-dlp انسٹال کریں

📦 یہ ایک پیکج ہے جو ویڈیو ڈاؤن لوڈ کرنے کے لیے استعمال ہوتا ہے۔

👇 ٹرمینل (یا Command Prompt) میں لکھیں:

pip install yt-dlp

✅ 3. Python فائل بنائیں

اپنے کمپیوٹر پر کوئی فولڈر بنائیں، جیسے:

C:\Users\Ayesha\Videos\yt-dlp-folder

پھر اس فولڈر کے اندر ایک Python فائل بنائیں جس کا نام رکھیں:

video_downloader.py

یعنی .py فائل Python code کے لیے ہوتی ہے۔


✅ 4. Python کوڈ لکھیں

اب اس .py فائل میں یہ کوڈ لکھیں:

import yt_dlp

# جس ویڈیو کا لنک ڈاؤن لوڈ کرنا ہے
video_url = 'https://www.youtube.com/watch?v=abc123xyz'  # ← یہاں اپنا یوٹیوب لنک لکھیں

# ڈاؤن لوڈ کرنے کا سیٹ اپ
ydl_opts = {
    'format': 'best',
    'outtmpl': '%(title)s.%(ext)s',  # ویڈیو کا نام ویسا ہی ہوگا جیسا یوٹیوب پر ہے
}

# ویڈیو ڈاؤن لوڈ کرنا
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    ydl.download([video_url])

✅ 5. فائل کو رن (چلائیں)

🔧 اب ٹرمینل یا Command Prompt میں جائیں، اور اسی فولڈر میں جا کر یہ لکھیں:

python video_downloader.py

🎉 اب ویڈیو ڈاؤن لوڈ ہونا شروع ہو جائے گی!

------------------------------------------------------------------------------------------------------------------------




------------------------------------------------------------------------------------------------------------------------
video_downloader.py CODE
C:\Users\Tahir\Desktop\Jason>python video_downloader.py

------------------------------------------------------------------------------------------------------------------------
import yt_dlp # جس ویڈیو کا لنک ڈاؤن لوڈ کرنا ہے video_url = 'https://www.youtube.com/shorts/GC0J281o-Hc' # ← یہاں اپنا یوٹیوب لنک لکھیں # ڈاؤن لوڈ کرنے کا سیٹ اپ ydl_opts = { 'format': 'best', 'outtmpl': '%(title)s.%(ext)s', # ویڈیو کا نام ویسا ہی ہوگا جیسا یوٹیوب پر ہے } # ویڈیو ڈاؤن لوڈ کرنا with yt_dlp.YoutubeDL(ydl_opts) as ydl: ydl.download([video_url])
------------------------------------------------------------------------------------------------------------------------
MY.py
------------------------------------------------------------------------------------------------------------------------
from yt_dlp import YoutubeDL

with YoutubeDL() as ydl:
    ydl.download(['https://www.youtube.com/watch?v=dQw4w9WgXcQ'])

------------------------------------------------------------------------------------------------------------------------

FIRST DOWNLOAD PYTHON NEW VERSION RUN COMMAND IN CMD
pip install yt_dlp

IMPORTANT STEP DOWNLOAD yt_dlp WITH COMMAND PROMPT IT DOWNLOAD IN HIDDEN FOLDERS
------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------




0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

FB Gadgets | Template Designed by Fatakat PhotosCoolBThemes.com
Code by : paid web directory

https://www.google.co.uk/search?q=site%3Ablogspot.com+fbgadgets