feat(utils): add animeprovider util that assigns a random quality string if not present

This commit is contained in:
Benex254
2024-08-11 11:22:43 +03:00
parent 45ccaec458
commit 7b2096e0eb

View File

@@ -1,4 +1,5 @@
import re
from itertools import cycle
# Dictionary to map hex values to characters
hex_to_char = {
@@ -34,6 +35,15 @@ hex_to_char = {
}
def give_random_quality(links: list[dict]):
qualities = cycle(["1080", "720", "360"])
return [
{"link": link["link"], "quality": quality}
for link, quality in zip(links, qualities)
]
def decode_hex_string(hex_string):
"""some of the sources encrypt the urls into hex codes this function decrypts the urls