-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
836e1f9
commit 15fc2c1
Showing
4 changed files
with
84 additions
and
13 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 () |