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

Very simple xargs commands fail #557

Closed
ghost opened this issue Jul 31, 2022 · 6 comments
Closed

Very simple xargs commands fail #557

ghost opened this issue Jul 31, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jul 31, 2022

ytfzf --channel-link=https://youtube.com/c/<> | xargs ytfzf -c invidious-channel

or even

cat a | xargs ytfzf

Describe the bug

I can only get echo to work with xargs for ytfzf. Even programs like cat fail.

To Reproduce

Try any command other than echo which will print a string to stdout, and then xargs it in.

Expected behavior

ytfzf should accept stdout regardless of it's origin.

Screenshots

Information

  • OS: Debian 11
  • Terminal: xfce-terminal
  • Ytfzf version: latest
  • Output of ls -l "$(which sh)" (if your using fish: ls -l (which sh)):
lrwxrwxrwx 1 root root 4 Jul 17 16:43 /usr/bin/sh -> dash
@ghost ghost added the bug Something isn't working label Jul 31, 2022
@Euro20179
Copy link
Collaborator

Euro20179 commented Aug 1, 2022

I cannot replicate this, regardless, in your situation you don't need xargs as ytfzf accepts stdin as input

cat a | ytfzf -
ytfzf --channel-link=... | ytfzf -c invidious-channel -

What error shows up when you try to run that?

@ghost
Copy link
Author

ghost commented Aug 1, 2022

I cannot replicate this, regardless, in your situation you don't need xargs as ytfzf accepts stdin as input

cat a | ytfzf - ytfzf --channel-link=... | ytfzf -c invidious-channel -

What error shows up when you try to run that?

Hi Euro20179. Thanks for the quick reply. I get this error (using the channel thpsvideos:

rm: cannot remove '/tmp/ytfzf-env': No such file or directory
> https://youtube.com/channel/UCIDuzEnSK30aJn1bSVNaaKg
/videos (pg: 1)e (with https://y.com.sb) channel: https://youtube.com/channel/UCIDuzEnSK30aJn1bSVNaaKg
invidious-channel failed to load website
Nothing was scraped

I've also made a video of it available on my site: https://filmsbytom.com/ytfzf0.mp4.

@Euro20179
Copy link
Collaborator

yay I was able to replicate the bug, now I just need to fix it.

@Euro20179
Copy link
Collaborator

Euro20179 commented Aug 1, 2022

Ok so the problem is that something is adding a \r (carrage return) (not even a new line) at the end it could be xargs or ytfzf so i'll have to go hunt for that.

Edit:
I believe it's xargs, don't know why but either way,

adding _search=$(printf "%s" "$_search" | sed 's/[\r\n]$//g') seems to fix it.

Edit 2:
nvm it was curl adding the return character, and it's fixed by just taking it out of the result.

Euro20179 added a commit that referenced this issue Aug 1, 2022
@Euro20179
Copy link
Collaborator

This has been resolved in this commit: ae1cbfd and will be in version 2.4.1

@ghost
Copy link
Author

ghost commented Aug 1, 2022

Thanks so much!

@ghost ghost closed this as completed Aug 1, 2022
This issue was closed.
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

1 participant