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

[Question][Request]logging-configuration question and display log request #5123

Closed
gcfvfhg opened this issue Jan 28, 2024 · 5 comments
Closed

Comments

@gcfvfhg
Copy link

gcfvfhg commented Jan 28, 2024

No description provided.

@gcfvfhg
Copy link
Author

gcfvfhg commented Jan 28, 2024

logging-configuration question

Configuration:

    "output":
    {
        "mode": "auto",
        "progress": true,
        "shorten": true,
        "logfile": {
              "path": "log.txt",
              "mode": "a",
	      "format": {
		            "debug"  : "[debug][{asctime}][{levelname}][{name}][{extractor.category}] {message}",
                    "info"   : "[info][{asctime}][{levelname}][{name}][{extractor.category}] {message}",
                    "warning": "[warning][{asctime}][{levelname}][{name}][{extractor.category}] {message} [Source URL: {extractor.url}][{path.directory}{path.filename}][{url}]",
                    "error"  : "[error][{asctime}][{levelname}][{name}][{extractor.category}] {message} [Source URL: {extractor.url}][{path.directory}{path.filename}][{url}]"
	      },
              "format-date": "%Y-%m-%d-%H-%M-%S"
        },
        "unsupportedfile": {
            "path": "unsupported.txt",
            "mode": "a",
            "format": "{asctime} {message}[{path.directory}{path.filename}]",
            "format-date": "%Y-%m-%d-%H-%M-%S"
        },
       "errorfile": {
            "path": "errorfile.txt",
            "mode": "a",
            "format": "{asctime} {message}",
            "format-date": "%Y-%m-%d-%H-%M-%S"
        }


    },

I refer to the link below

https://github.com/mikf/gallery-dl/issues/3908
https://gdl-org.github.io/docs/configuration.html#logging-configuration

I want the logfile to display the chapter URL and image URL
Is this option currently available?

@gcfvfhg
Copy link
Author

gcfvfhg commented Jan 28, 2024

display log request

normal url:
https://comic.naver.com/bestChallenge/list?titleId=763952

The following URL can be viewed normally with a browser:
https://comic.naver.com/webtoon/list?titleId=763952

run gallery-dl https://comic.naver.com/webtoon/list?titleId=763952

result:

C:\Users\n\Downloads>gallery-dl https://comic.naver.com/webtoon/list?titleId=763952

C:\Users\n\Downloads>

I hope it can show a log message to remind me that I am using an incorrect URL.

@mikf
Copy link
Owner

mikf commented Feb 17, 2024

You can include the input URL (i.e. chapter URL) by adding {extractor.url} to your logging format strings.

/webtoon/ URLs like https://comic.naver.com/webtoon/list?titleId=763952 are now fixed (de752eb).

@mikf mikf closed this as completed Feb 17, 2024
@gcfvfhg
Copy link
Author

gcfvfhg commented Feb 29, 2024

@mikf

thank you for your reply.

Could I double check?

Is there currently no format for displaying image URLs?

ex:

log:
[error][download][naverwebtoon] Failed to download 001.jpg [Source URL: https://comic.naver.com/bestChallenge/detail?titleId=763952&no=93][.\gallery-dl\naverwebtoon\763952\93\001.jpg]



https://comic.naver.com/webtoon/list?titleId=763952

chapter url:
https://comic.naver.com/bestChallenge/detail?titleId=763952&no=93

image url:
https://image-comic.pstatic.net/user_contents_data/challenge_comic/2024/02/26/342080/upload_7016952789187376225.jpeg

@mikf
Copy link
Owner

mikf commented Feb 29, 2024

You could enable metadata-url and then use {path.kwdict[…]} in your logging format string, although that is somewhat sketchy. Don't expect this to keep working forever, since it is accessing some "deeper" data structures.

-o metadata-url=image_url -o output.log='{path.kwdict[image_url]}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants