FarhadMadadzade
commited on
Commit
•
08c869e
1
Parent(s):
4969c68
fixed another bug
Browse files- video_downloader.py +6 -0
video_downloader.py
CHANGED
@@ -2,6 +2,8 @@ import urllib.request
|
|
2 |
import requests
|
3 |
from bs4 import BeautifulSoup
|
4 |
from pytube import YouTube
|
|
|
|
|
5 |
|
6 |
|
7 |
def get_response(url):
|
@@ -44,6 +46,10 @@ def download_video(date):
|
|
44 |
|
45 |
|
46 |
def download_video1(date):
|
|
|
|
|
|
|
|
|
47 |
# Get the webpage
|
48 |
url = f"https://www.riksdagen.se/sv/sok/?avd=webbtv&from={date}&tom={date}&doktyp=kam-vo"
|
49 |
|
|
|
2 |
import requests
|
3 |
from bs4 import BeautifulSoup
|
4 |
from pytube import YouTube
|
5 |
+
import os
|
6 |
+
import glob
|
7 |
|
8 |
|
9 |
def get_response(url):
|
|
|
46 |
|
47 |
|
48 |
def download_video1(date):
|
49 |
+
# Delete any existing .mp4 files
|
50 |
+
for mp4_file in glob.glob("*.mp4"):
|
51 |
+
os.remove(mp4_file)
|
52 |
+
|
53 |
# Get the webpage
|
54 |
url = f"https://www.riksdagen.se/sv/sok/?avd=webbtv&from={date}&tom={date}&doktyp=kam-vo"
|
55 |
|