-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add anime parser. more tweaks to handlers.
- Loading branch information
1 parent
7580b29
commit 91e6f28
Showing
5 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,14 +1,26 @@ | ||
import argparse | ||
import sys | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="Parse filename or torrent name using Parsett") | ||
parser.add_argument('filename', type=str, help="Parse filename") | ||
parser.add_argument('filename', type=str, help="The name of the file or torrent to be parsed") | ||
parser.add_argument('-a', '--anime', action='store_true', help="Enable parsing of anime titles") | ||
parser.add_argument('-tl', '--translate-languages', action='store_true', help="Translate language codes (e.g., 'en', 'jp') to their full language names (e.g., 'English', 'Japanese')") | ||
|
||
args = parser.parse_args() | ||
if not args.filename: | ||
parser.print_help() | ||
sys.exit(1) | ||
|
||
if args.filename: | ||
from PTT import parse_title | ||
print(parse_title(args.filename)) | ||
from PTT import parse_title | ||
|
||
print( | ||
parse_title( | ||
args.filename, | ||
translate_languages=args.translate_languages, | ||
parse_anime=args.anime | ||
) | ||
) | ||
|
||
if __name__ == "__main__": | ||
main() |
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