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

Fix missing application of user-agent setting #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ghenry22
Copy link

@ghenry22 ghenry22 commented Oct 9, 2022

Additional for #214.

One place where the user-agent setting was not applied, resulting in some podcasts failing to download still. Creating a PR to highlight that this was missed as it is only mentioned in a comment on the previous PR.

credit to @wiseindy
https://github.com/wiseindy/podgrab

One place where the user-agent setting was not applied, resulting in some podcasts failing to download still.  Creating a PR to highlight that this was missed as it is only mentioned in a comment on the previous PR.

credit to @wiseindy
https://github.com/wiseindy/podgrab
setting := db.GetOrCreateSetting()
if len(setting.UserAgent) > 0 {
req.Header.Add("User-Agent", setting.UserAgent)
}
Copy link
Contributor

@fracai fracai Nov 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use the existing getRequest method from fileService.go. Replace the call to NewRequest on line 714 with getRequest as in:

req, err := getRequest(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

Successfully merging this pull request may close these issues.

None yet

2 participants