NNTmux / newznab-tmux

Laravel based usenet indexer
GNU General Public License v3.0
213 stars 53 forks source link

PPA think RAR is JPEG due to filename #1253

Closed ghost closed 1 year ago

ghost commented 2 years ago

Specific filename inside rar: blablablabla.jpeg.mp4 Subject inside NZB: subject="[2/33] - "BLABLABLA.Jpeg.XXX.1080p.MP4-blabla.vol00-01.par2" yEnc (1/3)"

Because there's jpeg in the filename in the NZB NNTmux tries to download the file and run it through Imagick to save as a "sample".

Looks like the regex here is the culprit: https://github.com/NNTmux/newznab-tmux/blob/master/Blacklight/processing/post/ProcessAdditional.php#L919

DariusIII commented 2 years ago

I checked some releases and they do have names like that and proper samples set for them.

ghost commented 2 years ago

I am running the exact same code but I do get this issue. I even tested the regex which matched the filename/subject, which means it will treat it as a JPEG. It saves the file to the tmpunrarpath as sampleimage.jpg

DariusIII commented 2 years ago

Regex does match that, that is true.

ghost commented 2 years ago

Still getting these:

ERROR: negative or zero image size `REMOVED/6/66f994f2-3561-4dce-82ae-eb800a9370b3/396969_REMOVED.bdrip.x264-doucement.jpg' @ error/image.c/CloneImage/794

No further stack trace.

ghost commented 2 years ago

Not sure why this happens but something like this might help in _processJPGMessageIDs()

                if(exif_imagetype($this->tmpPath.'samplepicture.jpg')) {
                    // Image is valid
                }
DariusIII commented 1 year ago

I am looking to fix this, but are we certain that these are not trully images? This regex specifically looks for jpeg inside the filename, not at the end of it.

ghost commented 1 year ago

It's been a while but since I added that if statement I don't think it happened again.