mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-04 22:24:14 -04:00
Add optional advanced flag to guess.py for debugging
This commit is contained in:
parent
283ba04f5e
commit
67cbf674b1
@ -7,7 +7,7 @@ if __name__ == "__main__":
|
|||||||
sys.path.append(str(Path(f"{__file__}/../../..").resolve()))
|
sys.path.append(str(Path(f"{__file__}/../../..").resolve()))
|
||||||
|
|
||||||
from guessit.api import default_api
|
from guessit.api import default_api
|
||||||
from typing import cast, List
|
from typing import cast, List, Any
|
||||||
from rebulk import Rebulk
|
from rebulk import Rebulk
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -20,14 +20,15 @@ rblk = cast(Rebulk, default_api.rebulk)
|
|||||||
rblk.rules(rules)
|
rblk.rules(rules)
|
||||||
|
|
||||||
|
|
||||||
def guessit(name: str, *, xem_titles: List[str] = []):
|
def guessit(name: str, *, xem_titles: List[str] = [], extra_flags: dict[str, Any] = {}):
|
||||||
return default_api.guessit(
|
return default_api.guessit(
|
||||||
name,
|
name,
|
||||||
{
|
{
|
||||||
"episode_prefer_number": True,
|
"episode_prefer_number": True,
|
||||||
"excludes": "language",
|
"excludes": "language",
|
||||||
"xem_titles": xem_titles,
|
"xem_titles": xem_titles,
|
||||||
},
|
}
|
||||||
|
| extra_flags,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -44,7 +45,11 @@ if __name__ == "__main__":
|
|||||||
async with ClientSession() as client:
|
async with ClientSession() as client:
|
||||||
xem = TheXemClient(client)
|
xem = TheXemClient(client)
|
||||||
|
|
||||||
ret = guessit(sys.argv[1], xem_titles=await xem.get_expected_titles())
|
ret = guessit(
|
||||||
|
sys.argv[1],
|
||||||
|
xem_titles=await xem.get_expected_titles(),
|
||||||
|
# extra_flags={"advanced": True},
|
||||||
|
)
|
||||||
print(json.dumps(ret, cls=GuessitEncoder, indent=4))
|
print(json.dumps(ret, cls=GuessitEncoder, indent=4))
|
||||||
|
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user