Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom extractor #1

Open
romariorobby opened this issue Apr 10, 2021 · 4 comments
Open

Custom extractor #1

romariorobby opened this issue Apr 10, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@romariorobby
Copy link

I tried to use custom extractor and create inside ytdl-nfo --config and run ytdl-nfo --extractor single.yaml files.json but it still use youtube.yaml template. so i rename youtube.yaml but it gives me error 'FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.local/lib/python3.9/site-packages/ytdl_nfo/configs/youtube.yaml'. did i missing something? and how to create custom extractor exactly? Thanks

@owdevel
Copy link
Owner

owdevel commented Apr 11, 2021 via email

@owdevel owdevel self-assigned this Apr 11, 2021
@romariorobby
Copy link
Author

Hello, Thanks for pointing this out. Turns out there was a bug where the custom extractor was only being called for folders and not individual files. The --extractor flag also just takes in the name of the file without the .yaml (will improve later to accept both), so just putting ytdl-nfo --extractor single files.json should work. As for creating custom extractors I don't have the time to flesh out the documents right now but what you did was correct. Creating a new extractor with {your_extractor_name}.yaml in the --config and calling the command is the intended use pattern. For the actual extractor, the program is basically just a yaml template processor: tags in the yaml with {item} in it will be replaced by that item in the json file. There is some additional logic for handling date formatting and attributes which you should be able to understand by just running the youtube extractor and comparing the yaml to the output nfo. Hope this helps. I intend to keep updating the program eventually when I get more time so thank you for reaching out. Let me know if you need more help. owdevel

On Sat, Apr 10, 2021 at 11:44 PM romariorobby @.***> wrote: I tried to use custom extractor and create inside ytdl-nfo --config and run ytdl-nfo --extractor single.yaml files.json but it still use youtube.yaml template. so i rename youtube.yaml but it gives me error 'FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.local/lib/python3.9/site-packages/ytdl_nfo/configs/youtube.yaml'. did i missing something? and how to create custom extractor exactly? Thanks — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#1>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADES276Z5O7XJJ5RWPPMMVLTIBI4TANCNFSM42WQZE4Q .

Hmm, calling this command ytdl-nfo --extractor single files.json (without .yaml) still doesn't work for me (i've tried before) and it keeps executed the default extractor (youtube.yaml).

@owdevel
Copy link
Owner

owdevel commented Apr 15, 2021

Hmm.. it seems to be working for me with the latest version. Have you updated the package through pip/cloning? Could you post an ls of your --config folder? It looks like you installed via pip but could you confirm how you installed it?

@romariorobby
Copy link
Author

yes, i've been installed the latest version with this command
pip install git+https://github.com/owdevel/ytdl_nfo.git

~ $ ytdl-nfo --config
/home/user/.local/lib/python3.9/site-packages/ytdl_nfo/configs
~/.local/lib/python3.9/site-packages/ytdl_nfo/configs $ ls
single.yaml youtube.yaml

@owdevel owdevel added the bug Something isn't working label Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants