mhogomchungu / media-downloader

Media Downloader is a Qt/C++ front end to yt-dlp, youtube-dl, gallery-dl, lux, you-get, svtplay-dl, aria2c, wget and safari books..
GNU General Public License v2.0
1.34k stars 101 forks source link

how to filter keywords with "Get List Options"? #378

Closed R8s6 closed 4 months ago

R8s6 commented 4 months ago

Hi,

Is there a way to filter the list?

In Get List Options, I tried --cookies-from-browser chromium --match-filter "title!=keyword", (also tried title=keyword) and I had an "invalid filter part" error:

ERROR: Invalid filter part '"title=keyword"'
Traceback (most recent call last):
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1587, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1743, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1872, in process_ie_result
    return self.__process_playlist(ie_result, download)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1935, in __process_playlist
    if self._match_entry(common_info, incomplete=True) is not None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1514, in _match_entry
    reason = check_filter()
             ^^^^^^^^^^^^^^
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1484, in check_filter
    ret = match_filter(info_dict, incomplete=incomplete)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/utils/_utils.py", line 3253, in _match_func
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/utils/_utils.py", line 3253, in <genexpr>
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/utils/_utils.py", line 3233, in match_str
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/utils/_utils.py", line 3234, in <genexpr>
  File "/home/abc/.local/share/media-downloader/bin/yt-dlp/yt_dlp/utils/_utils.py", line 3223, in _match_one
ValueError: Invalid filter part '"title=lifeano"'

[media-downloader] Download Failed(ErrorCode=1)

Thanks!

P.S. I'm using the Linux git version (Arch linux)

mhogomchungu commented 4 months ago

What are you trying to do?

R8s6 commented 4 months ago

for example, let's say, out of 1000 videos in the playlist, there are 200 that have the keyword "money", then i want to download the other 800 videos that don't have "money" in the titles. how to achieve this? Thanks!

mhogomchungu commented 4 months ago

Its not possible with the latest released version because of a bug i just fixed.

Update from git first and then add the following:-

  1. --match-filter "title !~= (?i)money" if you want to exclude all entries with titles that has word "money" in it.
  2. --match-filter "title ~= (?i)money" if you want to include only entries with a title that has a word "money" in it.
mhogomchungu commented 4 months ago

A simpler solution is to use --match-title money to only have entries with "money" word in their titles and --reject-title money to only have entries that do not have "money" word in their titles.