Compare commits

...

5 Commits

Author SHA1 Message Date
benex
f1c352d4ff chore: bump version (v2.7.2) 2024-11-10 12:29:46 +03:00
benex
714533d845 refactor(cli): update config options and set fastanime config environs 2024-11-10 12:06:44 +03:00
benex
56dd25df8d refactor(cli): update config options
This commit updates the configuration options in the CLI module. Specifically, it modifies the "image_previews" option to be platform-dependent, setting it to "True" for non-Windows platforms and "False" for Windows. Additionally, it sets the "normalize_titles" option to "True". These changes improve the behavior and user experience of the CLI.
2024-11-10 12:06:17 +03:00
benex
8248dc53df fix: text preview not showing on windows 2024-11-10 12:05:32 +03:00
Benex254
1a8a187de6 docs: update readme 2024-11-09 00:27:49 +03:00
6 changed files with 104 additions and 16 deletions

105
README.md
View File

@@ -663,8 +663,8 @@ fastanime serve
# specify host and port
fastanime serve --host <host> --port <port>
```
An example instance is hosted by [render](https://fastanime.onrender.com/)
An example instance is hosted by [render](https://fastanime.onrender.com/)
Examples:
@@ -1094,7 +1094,6 @@ Result
**Get anime by id:**
```bash
curl 'https://fastanime.onrender.com/anime/8aM5BBoEGLvjG3MZm'
```
@@ -1109,14 +1108,7 @@ Result
"id": "8aM5BBoEGLvjG3MZm",
"title": "Sayounara Ryuusei, Konnichiwa Jinsei",
"availableEpisodesDetail": {
"sub": [
"6",
"5",
"4",
"3",
"2",
"1"
],
"sub": ["6", "5", "4", "3", "2", "1"],
"dub": [],
"raw": []
},
@@ -1205,6 +1197,99 @@ Result
</details>
**Get Episode Streams by AniList Id:**
```bash
curl 'https://fastanime.onrender.com/watch/269?episode=1&translation_type=dub'
```
<details>
<summary>
Results
</summary>
```json
[
{
"server": "gogoanime",
"headers": {},
"subtitles": [],
"episode_title": "Bleach; Episode 1",
"links": [
{
"link": "https://www032.anzeat.pro/streamhls/f643f0c19d5bee9f1c3aed888eee75d6/ep.1.1709258176.m3u8",
"hls": true,
"mp4": false,
"resolutionStr": "hls P",
"priority": 3,
"quality": "1080"
},
{
"link": "https://www032.anicdnstream.info/videos/hls/WEJ7719z_r37wHYpaOsTqQ/1731115258/76805/f643f0c19d5bee9f1c3aed888eee75d6/ep.1.1709258176.m3u8",
"hls": true,
"mp4": false,
"resolutionStr": "HLS1",
"priority": 2,
"quality": "720"
},
{
"link": "https://workfields.maverickki.lol/7d2473746a243c246e727276753c29297171713635342867686f65626875727463676b286f68606929706f62636975296e6a752951434c3131373f7c59743531714e5f76674975527757293731353737373334333e2931303e36332960303235603665373f62336463633f603765356763623e3e3e636363313362302963762837283731363f34333e373130286b35733e242a2476677475634e6a75243c727473632a2462677263243c373135373634363236363636367b",
"hls": true,
"resolutionStr": "Alt",
"src": "https://workfields.maverickki.lol/7d2473746a243c246e727276753c29297171713635342867686f65626875727463676b286f68606929706f62636975296e6a752951434c3131373f7c59743531714e5f76674975527757293731353737373334333e2931303e36332960303235603665373f62336463633f603765356763623e3e3e636363313362302963762837283731363f34333e373130286b35733e242a2476677475634e6a75243c727473632a2462677263243c373135373634363236363636367b",
"priority": 1,
"quality": "480"
}
]
},
{
"server": "Yt",
"episode_title": "Bleach; Episode 1",
"headers": {
"Referer": "https://allanime.day/"
},
"subtitles": [],
"links": [
{
"link": "https://tools.fast4speed.rsvp//media3/videos/XqKvkSEty5koms32i/dub/1",
"quality": "1080"
}
]
},
{
"server": "wixmp",
"headers": {},
"subtitles": [],
"episode_title": "Bleach; Episode 1",
"links": [
{
"link": "https://repackager.wixmp.com/video.wixstatic.com/video/eba0c8_706b389e50f94fe5bf8c72e2f10c545e/,720p,480p,/mp4/file.mp4.urlset/master.m3u8",
"hls": true,
"resolutionStr": "Hls",
"quality": "1080"
}
]
},
{
"server": "sharepoint",
"headers": {},
"subtitles": [],
"episode_title": "Bleach; Episode 1",
"links": [
{
"link": "https://myanime.sharepoint.com/sites/anime/_layouts/15/download.aspx?share=EaNJF1eTtptGovmPAcR3_7QBH1gFepgMcBpL5YfyEM5Uhw",
"mp4": true,
"resolutionStr": "Mp4",
"src": "https://myanime.sharepoint.com/sites/anime/_layouts/15/download.aspx?share=EaNJF1eTtptGovmPAcR3_7QBH1gFepgMcBpL5YfyEM5Uhw",
"quality": "1080"
}
]
}
]
```
</details>
### MPV specific commands
The project now allows on the fly media controls directly from mpv. This means you can go to the next or previous episode without the window ever closing thus offering a seamless experience.

View File

@@ -6,7 +6,7 @@ if sys.version_info < (3, 10):
) # noqa: F541
__version__ = "v2.7.1"
__version__ = "v2.7.2"
APP_NAME = "FastAnime"
AUTHOR = "Benex254"

View File

@@ -9,6 +9,7 @@ from ..constants import (
USER_DATA_PATH,
USER_VIDEOS_DIR,
USER_WATCH_HISTORY_PATH,
S_PLATFORM
)
from ..libs.rofi import Rofi
@@ -40,8 +41,8 @@ class Config(object):
"force_window": "immediate",
"format": "best[height<=1080]/bestvideo[height<=1080]+bestaudio/best",
"icons": "false",
"image_previews": "true",
"normalize_titles": "true",
"image_previews": "True" if S_PLATFORM != "win32" else "False",
"normalize_titles": "True",
"notification_duration": "2",
"player": "mpv",
"preferred_history": "local",

View File

@@ -1591,6 +1591,8 @@ def fastanime_main_menu(
else:
config.load_config()
config.set_fastanime_config_environs()
config.anime_provider.provider = config.provider
config.anime_provider.lazyload_provider(config.provider)

View File

@@ -65,7 +65,7 @@ def save_image_from_url(url: str, file_name: str):
file_name: filename to use
"""
image = requests.get(url)
with open(f"{IMAGES_CACHE_DIR}/{file_name}.png", "wb") as f:
with open(os.path.join(IMAGES_CACHE_DIR,f"{file_name}.png"), "wb") as f:
f.write(image.content)
@@ -76,7 +76,7 @@ def save_info_from_str(info: str, file_name: str):
info: the information anilist has on the anime
file_name: the filename to use
"""
with open(f"{ANIME_INFO_CACHE_DIR}/{file_name}", "w") as f:
with open(os.path.join(ANIME_INFO_CACHE_DIR,file_name,), "w",encoding="utf-8") as f:
f.write(info)

View File

@@ -1,6 +1,6 @@
[project]
name = "fastanime"
version = "2.7.1"
version = "2.7.2"
description = "A browser anime site experience from the terminal"
license = "UNLICENSE"
readme = "README.md"