Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
shayan-azizi committed Feb 17, 2023
1 parent 836e1f9 commit 15fc2c1
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 13 deletions.
Binary file modified __pycache__/scrapper.cpython-310.pyc
Binary file not shown.
15 changes: 13 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,21 @@ def download ():
download_button.flash()

def pause_download ():
scrapper.pause_download()
global is_paused

if is_paused:
OBJ.resume()
is_paused = not is_paused

else:
OBJ.pause()
is_paused = not is_paused


def terminate_download ():
scrapper.terminate_download()
global OBJ

OBJ.stop()

def browse_file ():

Expand Down
13 changes: 2 additions & 11 deletions scrapper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import requests

URL = "https://mobomovies.fun/post/"
URL = "https://mobomoviez.fun/post/"


find = True
Expand All @@ -21,7 +21,7 @@ def normalize_name (series_name : str) -> str:
return result

def normalize_link (link_tag : str) -> str:
link = "https://mobomovies.fun/"
link = "https://mobomoviez.fun/"
append = False

for i in link_tag:
Expand Down Expand Up @@ -146,10 +146,6 @@ def find_link (page, season_number, resolution_number, episode):

file_name = file_name [::-1]





return [final_link, file_name]

def find_page (show_name : str):
Expand All @@ -165,11 +161,6 @@ def find_page (show_name : str):

else:
return page
# url, download_name = find_link(page, season_number, resolution_number, episode)

# OBJ = SmartDL(url, CONFIG["location"] + download_name)
# OBJ.start()


def terminate_download ():
OBJ.stop()
Expand Down
69 changes: 69 additions & 0 deletions tv-show-downloader-cli/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import requests
import json
import os
import time

COMMANDS = ["help", "h", "download", "d", "\n", "", "clear", "cls", "q", "quit", "commands"]

def find_page (name : str) -> str:
page = requests.get("https://mobomoviez.fun/post/" + name)

if "اوپس" in page.text:
return False

else:
return page.text




def corrected_name (name : str) -> str:
name = name.lower()

corrected_name = ""
for char in name:

if char != " ":
corrected_name += char

else:
corrected_name += "-"

return corrected_name


def main () -> None:
print("\033[1;32m Welcome to Tv-Show-Downloader CLI Version \n")

while True:
command = input("\033[1;30m~ ")

if command not in COMMANDS:
print (f"\033[1;31m Tv-Show-Download: command not found: {command}")

if command in ["clear", "cls"]:
os.system("clear")

if command in ["q", "quit"]:
quit()

if command in ["help", "h", "commands"]:
print ("Commands List\ndownload (d): Start downloading TV-Show\nhelp (h): Show this list\nclear (cls): Clear the screan\nquit (q): Exit from this program")

if command in ["download", "d"]:
show_name = input("Enter The TV-Show name: ")
show_name = corrected_name(show_name)

print ("Finding TV-Show ...")

if not find_page(show_name):
print ("\033[1;31m Sorry can't find that TV-Show")

else:
print ("")


show_name = input()

if __name__ == "__main__":
main ()

0 comments on commit 15fc2c1

Please sign in to comment.