watch-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: watch-cli
3
+ Version: 0.1.0
4
+ Summary: watch CLI tool
5
+ Requires-Python: >=3.10
6
+ Requires-Dist: typer
7
+ Requires-Dist: requests
8
+ Requires-Dist: rich
@@ -0,0 +1,16 @@
1
+ # watch
2
+
3
+ CLI tool to watch movies and series. (EARLY ACCESS)
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install imdb
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ imdb movie "inception"
15
+ imdb tv "breaking bad" --season 1 --episode 3
16
+ ```
@@ -0,0 +1,18 @@
1
+
2
+ [project]
3
+ name = "watch-cli"
4
+ version = "0.1.0"
5
+ description = "watch CLI tool"
6
+ requires-python = ">=3.10"
7
+ dependencies = [
8
+ "typer",
9
+ "requests",
10
+ "rich",
11
+ ]
12
+
13
+ [project.scripts]
14
+ watch = "watch.main:app"
15
+
16
+ [build-system]
17
+ requires = ["setuptools>=68"]
18
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,64 @@
1
+ import time
2
+ import typer
3
+ import requests
4
+ import webbrowser
5
+ from urllib.parse import quote
6
+ from typing import Annotated
7
+ from rich.progress import track
8
+
9
+
10
+
11
+
12
+ def progress_bar():
13
+ total = 0
14
+ for value in track(range(100), description="Processing..."):
15
+ # Fake processing time
16
+ time.sleep(0.01)
17
+ total += 1
18
+ print(f"Processed {total}.")
19
+
20
+
21
+
22
+ def get_data(name):
23
+ url = f"https://v3.sg.media-imdb.com/suggestion/titles/x/{quote(name)}.json"
24
+ r = requests.get(url)
25
+ return r.json()
26
+
27
+
28
+
29
+
30
+ def open_web(name):
31
+ data = get_data(name)
32
+ if "d" in data and len(data["d"]) > 0:
33
+ first = data["d"][0]
34
+ imdb_id = first["id"]
35
+ webbrowser.open(f"https://www.playimdb.com/title/{imdb_id}")
36
+ else:
37
+ print("not found")
38
+
39
+ app = typer.Typer()
40
+
41
+
42
+ @app.command("tv")
43
+ def tv(
44
+ name: Annotated[str, typer.Argument(help="Enter the series name")],
45
+ season: Annotated[int, typer.Option("-s","--season",help="Select season")] = None,
46
+ episode: Annotated[int, typer.Option("-e","--episode",help="Select episode")] = None,):
47
+
48
+ progress_bar()
49
+ data = get_data(name)
50
+ imdb_id = data["d"][0]["id"]
51
+ if season and episode:
52
+ webbrowser.open(f"https://vaplayer.ru/embed/tv/{imdb_id}/S{season}E{episode}")
53
+ else:
54
+ webbrowser.open(f"https://vaplayer.ru/embed/tv/{imdb_id}")
55
+
56
+ @app.command("movie")
57
+ def movie( name: Annotated[str, typer.Argument(help="Enter the movie name")],):
58
+ progress_bar()
59
+ data = get_data(name)
60
+ imdb_id = data["d"][0]["id"]
61
+ webbrowser.open(f"https://vaplayer.ru/embed/movie/{imdb_id}")
62
+
63
+ if __name__ == "__main__":
64
+ app()
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: watch-cli
3
+ Version: 0.1.0
4
+ Summary: watch CLI tool
5
+ Requires-Python: >=3.10
6
+ Requires-Dist: typer
7
+ Requires-Dist: requests
8
+ Requires-Dist: rich
@@ -0,0 +1,10 @@
1
+ README.md
2
+ pyproject.toml
3
+ watch/__init__.py
4
+ watch/main.py
5
+ watch_cli.egg-info/PKG-INFO
6
+ watch_cli.egg-info/SOURCES.txt
7
+ watch_cli.egg-info/dependency_links.txt
8
+ watch_cli.egg-info/entry_points.txt
9
+ watch_cli.egg-info/requires.txt
10
+ watch_cli.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ watch = watch.main:app
@@ -0,0 +1,3 @@
1
+ typer
2
+ requests
3
+ rich
@@ -0,0 +1 @@
1
+ watch