Add tentative typing

This commit is contained in:
Serene-Arc
2021-02-06 22:29:13 +10:00
committed by Ali Parlakci
parent 4143b86467
commit 185335e60b
20 changed files with 84 additions and 69 deletions

View File

@@ -1,5 +1,6 @@
import json
import os
import pathlib
import urllib.request
from bs4 import BeautifulSoup
@@ -10,7 +11,7 @@ from src.utils import GLOBAL
class Redgifs:
def __init__(self, directory, post):
def __init__(self, directory: pathlib.Path, post: dict):
try:
post['MEDIAURL'] = self.getLink(post['CONTENTURL'])
except IndexError:
@@ -27,7 +28,7 @@ class Redgifs:
getFile(filename, short_filename, directory, post['MEDIAURL'])
@staticmethod
def getLink(url):
def getLink(url: str) -> str:
"""Extract direct link to the video from page's source
and return it
"""