DeeeeeeM
commited on
Commit
·
0a9b09b
1
Parent(s):
0b9d716
deleted files: playlist.csv, yt-playlist-export.py
Browse files- playlist.csv +0 -0
- yt-playlist-export.py +0 -27
playlist.csv
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
yt-playlist-export.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 1 |
-
from yt_dlp import YoutubeDL
|
| 2 |
-
import csv
|
| 3 |
-
|
| 4 |
-
playlist_url = 'https://www.youtube.com/playlist?list=PLGRhcC_vtOra_TUIec1NgfHJIggPONtqU'
|
| 5 |
-
|
| 6 |
-
ydl_opts = {
|
| 7 |
-
'extract_flat': True,
|
| 8 |
-
'quiet': True,
|
| 9 |
-
'dump_single_json': True
|
| 10 |
-
}
|
| 11 |
-
|
| 12 |
-
with YoutubeDL(ydl_opts) as ydl:
|
| 13 |
-
result = ydl.extract_info(playlist_url, download=False)
|
| 14 |
-
|
| 15 |
-
entries = result.get('entries', [])
|
| 16 |
-
|
| 17 |
-
with open('playlist.csv', 'w', newline='', encoding='utf-8') as f:
|
| 18 |
-
writer = csv.writer(f)
|
| 19 |
-
writer.writerow(['Title', 'Video ID', 'URL']) # Header
|
| 20 |
-
|
| 21 |
-
for video in entries:
|
| 22 |
-
title = video.get('title', 'N/A')
|
| 23 |
-
video_id = video['id']
|
| 24 |
-
url = f'https://www.youtube.com/watch?v={video_id}'
|
| 25 |
-
writer.writerow([title, video_id, url])
|
| 26 |
-
|
| 27 |
-
print("✅ Video IDs and URLs saved to 'playlist.csv'")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|