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

--match-filter "Invalid filter part u" #24357

Closed
kolt54321 opened this issue Mar 15, 2020 · 1 comment
Closed

--match-filter "Invalid filter part u" #24357

kolt54321 opened this issue Mar 15, 2020 · 1 comment
Labels

Comments

@kolt54321
Copy link

@kolt54321 kolt54321 commented Mar 15, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.03.08
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

ubis@server:~/youtube_channel_archiver$ ./download_archive.sh
[debug] System config: []
[debug] User config: []
[debug] Custom config: [u'-v', u'--max-views', u'300000', u'--min-views', u'200', u'--match-filter', u'duration > 120
 & like_count > 40 & (like_count/(like_count + dislike_count)) > .90', u'-ciw', u'-o', u'/home/ubis/YT/%(up
load_date)s - %(uploader)s - %(title)s - [%(resolution)s].%(ext)s', u'--download-archive', u'youtube-dl-archive.txt',
 u'-a', u'youtube-dl-test.txt', u'-f', u'(bestvideo[vcodec^=av01][height>=2160][fps>30]/bestvideo[vcodec=vp9.2][heigh
t>=2160][fps>30]/bestvideo[vcodec=vp9][height>=2160][fps>30]\n/bestvideo[vcodec^=av01][height>=2160]/bestvideo[vcodec
=vp9.2][height>=2160]/bestvideo[vcodec=vp9][height>=2160]/bestvideo[height>=2160]\n/bestvideo[vcodec^=av01][height>=1
440][fps>30]/bestvideo[vcodec=vp9.2][height>=1440][fps>30]/bestvideo[vcodec=vp9][height>=1440][fps>30]\n/bestvideo[vc
odec^=av01][height>=1440]/bestvideo[vcodec=vp9.2][height>=1440]/bestvideo[vcodec=vp9][height>=1440]/bestvideo[height>
=1440]\n/bestvideo[vcodec^=av01][height>=1080][fps>30]/bestvideo[vcodec=vp9.2][height>=1080][fps>30]/bestvideo[vcodec
=vp9][height>=1080][fps>30]\n/bestvideo[vcodec^=av01][height>=1080]/bestvideo[vcodec=vp9.2][height>=1080]/bestvideo[v
codec=vp9][height>=1080]/bestvideo[height>=1080]\n/bestvideo[vcodec^=av01][height>=720][fps>30]/bestvideo[vcodec=vp9.
2][height>=720][fps>30]/bestvideo[vcodec=vp9][height>=720][fps>30]\n/bestvideo[vcodec^=av01][height>=720]/bestvideo[v
codec=vp9.2][height>=720]\n/bestvideo[vcodec=vp9][height>=720]/bestvideo[height>=720]/bestvideo)+\n(bestaudio[acodec=
opus]/bestaudio)/best', u'--external-downloader', u'aria2c', u'--external-downloader-args', u'-j 8 -s 8 -x 8 -k 5M',
u'--retries', u'20', u'--fragment-retries', u'20', u'--prefer-ffmpeg', u'--merge-output-format', u'mkv', u'--all-subs
', u'--embed-subs', u'--convert-subs', u'srt', u'--write-info-json', u'--add-metadata', u'--write-description', u'--e
xec', u'sh /home/ubis/youtube/moveit.sh', u'--sleep-interval', u'60']
[debug] Command-line args: [u'--config-location', u'youtube-dl.conf']
[debug] Batch file urls: [u'ytsearchdate9:piano', u'ytsearchdate9:kowloon']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.03.08
[debug] Python version 2.7.17 (CPython) - Linux-4.15.0-74-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[youtube:search:date] query "piano": Downloading page 1
[download] Downloading playlist: piano
[youtube:search:date] playlist piano: Collected 9 video ids (downloading 9 of them)
[download] Downloading video 1 of 9
[youtube] 0pi9PweR-ZE: Downloading webpage
WARNING: video doesn't have subtitles
[youtube] 0pi9PweR-ZE: Downloading MPD manifest
[download] Sugeng Dalu (FEMALE KE) Denny Caknan (KARAOKE PIANO) does not pass filter duration > 120 & like_count > 40 & (like_count/(like_count + dislike_count)) > .90, skipping ..
[download] Downloading video 2 of 9
[youtube] RF7A6NXoFsI: Downloading webpage
WARNING: video doesn't have subtitles
**ERROR: Invalid filter part u' (like_count/(like_count + dislike_count)) > .90'**
Traceback (most recent call last):
  File "/home/ubis/.local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 808, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/ubis/.local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 863, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/home/ubis/.local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1644, in process_video_result
    self.process_info(new_info)
  File "/home/ubis/.local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1744, in process_info
    reason = self._match_entry(info_dict, incomplete=False)
  File "/home/ubis/.local/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 759, in _match_entry
    ret = match_filter(info_dict)
  File "/home/ubis/.local/lib/python2.7/site-packages/youtube_dl/utils.py", line 4314, in _match_func
    if match_str(filter_str, info_dict):
  File "/home/ubis/.local/lib/python2.7/site-packages/youtube_dl/utils.py", line 4309, in match_str
    _match_one(filter_part, dct) for filter_part in filter_str.split('&'))
  File "/home/ubis/.local/lib/python2.7/site-packages/youtube_dl/utils.py", line 4309, in <genexpr>
    _match_one(filter_part, dct) for filter_part in filter_str.split('&'))
  File "/home/ubis/.local/lib/python2.7/site-packages/youtube_dl/utils.py", line 4302, in _match_one
    raise ValueError('Invalid filter part %r' % filter_part)
ValueError: Invalid filter part u' (like_count/(like_count + dislike_count)) > .90'

[download] Downloading video 3 of 9
[youtube] 5elG9Q8UkPY: Downloading webpage
[youtube] {18} signature length 106, html5 player vflQJ_oH3
[youtube] {136} signature length 102, html5 player vflQJ_oH3
[youtube] {247} signature length 106, html5 player vflQJ_oH3
[youtube] {135} signature length 106, html5 player vflQJ_oH3
[youtube] {244} signature length 106, html5 player vflQJ_oH3
[youtube] {134} signature length 106, html5 player vflQJ_oH3
[youtube] {243} signature length 106, html5 player vflQJ_oH3
[youtube] {133} signature length 102, html5 player vflQJ_oH3
[youtube] {242} signature length 106, html5 player vflQJ_oH3
[youtube] {160} signature length 106, html5 player vflQJ_oH3
[youtube] {278} signature length 106, html5 player vflQJ_oH3
[youtube] {140} signature length 102, html5 player vflQJ_oH3
[youtube] {249} signature length 106, html5 player vflQJ_oH3
[youtube] {250} signature length 106, html5 player vflQJ_oH3
[youtube] {251} signature length 102, html5 player vflQJ_oH3
WARNING: video doesn't have subtitles
[download] Skipping Beautiful Romantic Violin Love Songs - The Very Best Of Sax, Piano, Guitar Love Songs, because it has not reached minimum view count (160/200)
[download] Downloading video 4 of 9
[youtube] M38nNW4krCw: Downloading webpage
^C

Description

In the match filter, I am trying to use the following logic: --match-filter 'duration > 120 & like_count > 40 & (like_count/(like_count + dislike_count)) > .90'

The last part is to test for a like/dislike ratio of over 90%. However, this produces an error and isn't read by the match filter, even though the individual keys (like_count, dislike_count) are numeric, and valid. Any idea what syntax would make this work?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 15, 2020

Match filter does not support any kind of calculations.

@dstftw dstftw closed this Mar 15, 2020
@dstftw dstftw added the invalid label Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.