Skip to content

Commit

Permalink
Merge pull request #149 from kianmeng/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
sdaqo authored Jan 24, 2024
2 parents 64ce6cf + bd1149e commit ea07520
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 29 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ https://user-images.githubusercontent.com/63876564/162056019-ed0e7a60-78f6-4a2c-

- [Installation](#Installation)
- [Usage](#Usage)
- [Libary Usage](#libary-usage)
- [Library Usage](#library-usage)
- [What it can do](#what-it-can-do)
- [Other Versions](#other-versions)
- [Credits](#Credits)
Expand Down Expand Up @@ -106,18 +106,18 @@ Info:
- (**Optional**) Discord Presence for the anime you currently watch. This is off by default, activate it in the config (-c)
- (**Optional**) Ffmpeg to download m3u8 playlists, may be more stable but is slower than internal downloader.

# Libary Usage
# Library Usage

Documentation can be found [here](https://github.com/sdaqo/anipy-cli/blob/master/docs/anipycli_as_lib.py)

#### Important:

To import the libary, don't import `anipy-cli`, but `anipy_cli` (no '-' is allowed)
To import the library, don't import `anipy-cli`, but `anipy_cli` (no '-' is allowed)

# Advanced Usage Examples
#### Little example of using anipy-cli for automatically keeping anime library up-to-date:
```
# Cronjob runs every 2 minutes and checks wether anipy-cli is still running or not
# Cronjob runs every 2 minutes and checks whether anipy-cli is still running or not
# (only run the job if last one is finished)
*/2 * * * * username pidof -x anipy-cli || anipy-cli -Ma >> /var/log/anipy-cli.log
Expand Down
2 changes: 1 addition & 1 deletion anipy_cli/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def _download_key(self, content):

def _get_fname(self) -> str:
"""
This function returns what the filename for the outputed video should be.
This function returns what the filename for the outputted video should be.
It finds this by using data in self.entry and the Config.
Expand Down
2 changes: 1 addition & 1 deletion anipy_cli/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def error(error: str) -> None:
def response_err(req, link) -> None:
"""
Function that checks if a request
was succesfull.
was successful.
"""
if req.ok:
pass
Expand Down
3 changes: 1 addition & 2 deletions anipy_cli/player/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def get_player(rpc_client=None, player_override="") -> PlayerBaseType:
player = Path(player)

if Path(player.name).stem == "mpv" and cfg.reuse_mpv_window:
from anipy_cli.player.players.mpv_contrl import MpvControllable

from anipy_cli.player.players.mpv_control import MpvControllable
return MpvControllable(rpc_client=rpc_client)

player_dict = {"mpv": Mpv, "mpvnet": Mpv, "vlc": Vlc, "syncplay": Syncplay}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion anipy_cli/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def pick_show(self, cancelable=False):
"""
Cli Function that
Lets you pick a show from
yout query, filles the category_url
yout query, filled the category_url
field from the entry and returns it.
"""
print_names(self.names)
Expand Down
6 changes: 3 additions & 3 deletions anipy_cli/url_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_special_list(self):

def get_latest(self):
"""
Fetch latest episode avalible
Fetch latest episode available
from a show and return it.
"""

Expand Down Expand Up @@ -253,7 +253,7 @@ def pick_range(self):
ep_list = ep_list[first_index : second_index + 1]

if not ep_list:
error("invlid input1")
error("invalid input1")
else:
return [x["ep"] for x in ep_list]

Expand Down Expand Up @@ -414,7 +414,7 @@ def quality(self, json_data):
JSON repons and change
stream url to the either
the quality option that was picked,
or the best one avalible.
or the best one available.
"""
self.entry.quality = ""

Expand Down
18 changes: 9 additions & 9 deletions docs/anipycli_as_lib.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
Examples to use
anipy-cli as libary.
More descriptions can be
Examples to use
anipy-cli as library.
More descriptions can be
found by the functions/classes itself.
"""
# Don't run this file, it wont work, it is only for demonstration purposes
# Don't run this file, it won't work, it is only for demonstration purposes

import anipy_cli

Expand Down Expand Up @@ -43,7 +43,7 @@
# Episode Handling is done with
# epHandler, it can get the latest
# episode, generate episode links,
# get next episode and previos episode.
# get next episode and previous episode.
# it requires the fields category_url,
# and ep.
ep_class = anipy_cli.epHandler(entry)
Expand All @@ -64,7 +64,7 @@
# done with the videourl class, it takes an entry
# that has to at least have ep_url filled.
# It also takes a quality argument which can have
# the standart qualities (1080, 720 etc.) or worst/best as value.
# the standard qualities (1080, 720 etc.) or worst/best as value.
url_class = anipy_cli.videourl(entry, "best")
# generate stream url (this also, automatically generates the embed url)
url_class.stream_url()
Expand Down Expand Up @@ -117,8 +117,8 @@
vlc_player = anipy_cli.player.players.Vlc()

# This is a controllable mpv player, it has the same common methods
# as the other players but is a little special as you can completly
# controll the player. Read more about what you can do with it here:
# as the other players but is a little special as you can completely
# control the player. Read more about what you can do with it here:
# https://github.com/jaseg/python-mpv
contr_mpv_player = anipy_cli.player.players.MpvControllable()

Expand Down Expand Up @@ -170,7 +170,7 @@
# Create the class
seasonal_class = anipy_cli.Seasonal()
# Fetch latest episodes, this function returns
# a dictonary with the episodes, it looks like
# a dictionary with the episodes, it looks like
# this:
# {"name": {
# "ep_list": [[ep, ep-link], [], ...],
Expand Down
6 changes: 3 additions & 3 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ user_files_path: "~/anipy-cli/user_files"
# Default: user_files_path/history.json
history_file_path:
# Default: user_files_path/seasonals.json
seasonal_file_path:
seasonal_file_path:

# Url of the goganime website, only change if needed
gogoanime_url: "https://gogoanime.gg/"
Expand Down Expand Up @@ -80,7 +80,7 @@ dc_presence: False
auto_open_dl_defaultcli: False

# Mal user credentials
# Store your user/pw here if you don't want to get prompted for it everytime
# Store your user/pw here if you don't want to get prompted for it every time
mal_user: username
mal_password: password

Expand All @@ -99,6 +99,6 @@ mal_status_categories:

# Specify Anime Types that should be shown in search results.
# Defaults to sub and dub
anime_types:
anime_types:
- "sub"
- "dub"
4 changes: 2 additions & 2 deletions tests/download/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_hyouka_noffmpeg(show_entry):
assert download_path.is_file(), f"File was not created {download_path}"
assert (
download_path.stat().st_size > 10000000
), f"File is smaller than 10MB, maybe it wasnt correctly downloaded?"
), f"File is smaller than 10MB, maybe it wasn't correctly downloaded?"

download_path.unlink()

Expand All @@ -60,6 +60,6 @@ def test_hyouka_ffmpeg(show_entry):
assert download_path.is_file(), f"File was not created {download_path}"
assert (
download_path.stat().st_size > 10000000
), f"File is smaller than 10MB, maybe it wasnt correctly downloaded?"
), f"File is smaller than 10MB, maybe it wasn't correctly downloaded?"

download_path.unlink()
2 changes: 1 addition & 1 deletion tests/episode_handling/test_ep_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_gen_link_regular():


def test_gen_link_with_unknown_chars():
"""Test link generation with a show with unkown charachters
"""Test link generation with a show with unknown characters
in its title (e.g. Saenai Heroine no Sodatekata ♭)"""

show_entry = epHandler(
Expand Down
2 changes: 1 addition & 1 deletion tests/history/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_hyouka_duplicate(show_entry):


def test_prepend(show_entry):
"""Check if able to prepend the entry if another one already exsists"""
"""Check if able to prepend the entry if another one already exists"""
MD5 = "fe772be16ced55a1618ecd16743b7f5b"

history(show_entry).write_hist()
Expand Down
2 changes: 1 addition & 1 deletion tests/seasonal/test_seasonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_del_hyouka(show_details):


def test_update_hyouka(show_details):
"""Check if updateing a show works"""
"""Check if updating a show works"""
MD5 = "0dc5e6db1089f5e9ccf42f1ed443076c"

Seasonal().add_show(*show_details)
Expand Down

0 comments on commit ea07520

Please sign in to comment.