mirror of
https://github.com/karl0ss/GoGoDownloader.git
synced 2025-04-26 19:49:23 +01:00
Update backend.py
This commit is contained in:
parent
9d4dc53961
commit
bda3ead826
@ -7,7 +7,6 @@ from bs4 import BeautifulSoup
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from colorama import Fore
|
from colorama import Fore
|
||||||
from random import choice
|
from random import choice
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(init=True)
|
@dataclass(init=True)
|
||||||
@ -102,11 +101,10 @@ class Download:
|
|||||||
def download_episodes(self, url):
|
def download_episodes(self, url):
|
||||||
client = req.session()
|
client = req.session()
|
||||||
with client.get(url[1], headers=self.random_headers(), stream=True, timeout=10) as workingurl:
|
with client.get(url[1], headers=self.random_headers(), stream=True, timeout=10) as workingurl:
|
||||||
time.sleep(1)
|
|
||||||
episode_name = "EP." + url[0] + ".mp4"
|
episode_name = "EP." + url[0] + ".mp4"
|
||||||
file_loc = os.path.join(self.folder, episode_name)
|
file_loc = os.path.join(self.folder, episode_name)
|
||||||
with open(file_loc, "w+b") as file:
|
with open(file_loc, "w+b") as file:
|
||||||
shutil.copyfileobj(workingurl.raw, file)
|
shutil.copyfileobj(workingurl.raw, file, 8192)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(init=True)
|
@dataclass(init=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user