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

add hl=en to query string #54

Closed
wants to merge 2 commits into from
Closed

add hl=en to query string #54

wants to merge 2 commits into from

Conversation

oolongmen
Copy link
Contributor

add hl=en to query string so that response will be display in english and titles can be correctly parse.

force response to be display in english that titles can be correctly parse.
@alexanderepstein
Copy link
Owner

I do see the issue that may occur if a user is from a different country but I am not sure this is the solution.
Try going to https://www.youtube.com/results?search_query=video\?hl=fr and notice how the flag is actually in the search itself, I think you meant to make it more like this https://www.youtube.com/results?search_query=video&hl=fr however if you aren't from france and click that link it will still view the page in english but it will add a little bar at the top allowing you to switch languages. The issue here is that there is no way to force the language without clicking the part of the bar that allows this (something bash-snippets cannot automate)

@oolongmen
Copy link
Contributor Author

Yes, it is intend to pass as an extra argument to query string. From I live, if I do a search query without this argument using curl I will get response in non-english and therefore no Duration and grep will fail. This extra query argument allows the response to be return in english so that grep will not fail.

do a "curl -A curl -s https://www.youtube.com/results\?search_query\=family" as in ytview script will return me this
youtube_query_response.txt

and doing "curl -A curl -s https://www.youtube.com/results\?search_query\=family\&hl\=en" will return me this
youtube_query_response_with_hl.txt

@alexanderepstein
Copy link
Owner

Can you refork the repository and add this change with a new pull request. I changed the command from being httpGet link to httpGet "link" which means no escape characters are necessary and this makes the code easier to read. Sorry about that I didn't write ytview and didn't notice the escape usage.

@oolongmen
Copy link
Contributor Author

sure. no problem.

@oolongmen oolongmen closed this Jul 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants