fetchurls icon indicating copy to clipboard operation
fetchurls copied to clipboard

[Feature Request] Add Option for User-Agent

Open sommer-gei opened this issue 3 years ago • 4 comments

Hey Adam, thank you for your nice little script! :-)

I ran into the problem that the website I'd like to fetch all URLs from blocked the default wget User-Agent (currently "Wget/1.20.3 (linux-gnu)"). To progress with my task I manually changed your (current) script and added a User-Agent string (to the wget command) and it worked very well.

Question: Are you willing to add an option for the User-Agent?

If yes, I would prepare a PR … :-)

KR

sommer-gei avatar Nov 26 '21 13:11 sommer-gei

Sure, feel free to submit a PR

adamdehaven avatar Nov 26 '21 14:11 adamdehaven

FYI: In the meantime I (temp.) changed the User-Agent with a local ~/.wgetrc file with this content

user-agent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0"

sommer-gei avatar Aug 15 '22 14:08 sommer-gei

@sommer-gei did you ever prepare the Pull Request? I'm happy to add as an option if you want to submit the changes; just please limit the changes to only adding the User Agent option

adamdehaven avatar Aug 22 '22 01:08 adamdehaven

@adamdehaven Nope, ATM no PR. :-/

(Changing the wget UA manually in the script code is no problem. Implementing/adding the UA as a script CLI parameter is more complex as I thought … #sry)

sommer-gei avatar Aug 22 '22 06:08 sommer-gei