yewtube icon indicating copy to clipboard operation
yewtube copied to clipboard

Search arguments not working

Open NerfyGek0 opened this issue 2 years ago • 4 comments

Issue

Search arguments don't seem to work. I would specifically like to use the --after argument

I am a git and python noob. I am sorry if the answer is right there and I did not see it, I am trying.

Example:

Searching for /<some_topic> -l or /<some_topic> --live return the same results as /<come_topic>. I was expecting that it would only return live streams. I have tried all other arguments as well (-d, -a, -c) all seem to ignore the arguments. I used --live in the above example as it does not require a value; so easy to replicate issue.

I have search the issues for yewtube (open and closed) but did not find anything obviously related to this.

Possible Answer

Looking at commands/search.py the section that seems to handle the arguments appears commented out. Not sure if this is the answer or if it has been re-implemented elsewhere. If this functionality has been removed then maybe the embedded help text help search menu should be updated?

Environment

Fedora Silverblue 35 > Installed via toobox (fedora 35 image) Installed yt using pipx YewTube version 2.8.1 python 3.10.2 youtube-dl 2021-12-17

NerfyGek0 avatar Mar 16 '22 11:03 NerfyGek0

i can confirm this

https://github.com/iamtalhaasghar/yewtube/blob/67e5be7b5aa02d25f1242fbd105325f6374bef36/mps_youtube/commands/search.py#L276-L303

it just mean all option will be ignored and yewtube will do normal search

there is possibility to create custom search but i have to dig deeper https://github.com/alexmercerind/youtube-search-python#search-with-a-filter-or-sort

rachmadaniHaryono avatar Mar 16 '22 12:03 rachmadaniHaryono

Thanks rachmadaniHaryono,

If this is a TODO and its not going to be implemented for a while then maybe the below lines should be removed from the help so people do not try to use it. I spent more time than I would like to admit today trying to figure out what I was doing wrong :)

https://github.com/iamtalhaasghar/yewtube/blob/67e5be7b5aa02d25f1242fbd105325f6374bef36/mps_youtube/helptext.py#L48-L54

Should I make a pull request to remove these lines as it seems to be a simple (non-code) change. Would this be ok?

NerfyGek0 avatar Mar 16 '22 13:03 NerfyGek0

Should I make a pull request to remove these lines as it seems to be a simple (non-code) change. Would this be ok?

that depend on @iamtalhaasghar

there are more option

  1. delete as you suggested
  2. just add note that it is not used for now
  3. move the help text to comment section. it is still on the code but as comment

i am against option 1 because it will be added later

my best recommendation is option 2

also it is not only help text but also this part https://github.com/iamtalhaasghar/yewtube/blob/67e5be7b5aa02d25f1242fbd105325f6374bef36/mps_youtube/commands/search.py#L14-L17

it also show that there is need to unify help text and that argument parser

rachmadaniHaryono avatar Mar 16 '22 13:03 rachmadaniHaryono

Agree, 2 or 3 would be better options. Maybe something like this:

Search Arguments: Please note these are in development and are currently unavailable. -d, --duration Can be any/short/medium/long -a, --after Date in YYYY-MM-DD or YYYY-MM-DDTHH:MM format -l, --live Limit search to livestreams -c, --category Search within a category, (number or string)

NerfyGek0 avatar Mar 16 '22 13:03 NerfyGek0