{"record":{"id":"b41fb54d7fa81d4a","repo":"danbooru/danbooru","slug":"source-url-has-multiple-images-enter-the-url-o","errorCode":null,"errorMessage":"#{source_url} has multiple images. Enter the URL of a single image","messagePattern":"#(.+?) has multiple images\\. Enter the URL of a single image","errorType":"validation","errorClass":"PostReplacementProcessor::Error","httpStatus":null,"severity":"error","filePath":"app/logical/post_replacement_processor.rb","lineNumber":79,"sourceCode":"\n  def rescale_notes(post)\n    x_scale = post.image_width.to_f  / post.image_width_was.to_f\n    y_scale = post.image_height.to_f / post.image_height_was.to_f\n\n    post.notes.each do |note|\n      note.rescale!(x_scale, y_scale)\n    end\n  end\n\n  def get_file_for_upload(source_url, referer_url, file)\n    return MediaFile.open(file) if file.present?\n    raise Error, \"No file or source URL provided\" if source_url.blank?\n\n    extractor = Source::Extractor.find(source_url, referer_url)\n    raise Error, \"No login credentials configured for #{extractor.site_name}.\" unless extractor.class.enabled?\n\n    image_urls = extractor.image_urls\n    raise Error, \"#{source_url} has multiple images. Enter the URL of a single image\" if image_urls.size > 1\n    raise Error, \"#{source_url} has no images\" if image_urls.size == 0\n\n    image_url = image_urls.first\n    file = extractor.download_file!(image_url)\n\n    [file, image_url]\n  end\nend\n","sourceCodeStart":61,"sourceCodeEnd":88,"githubUrl":"https://github.com/danbooru/danbooru/blob/91fec095644078f87729db85d8f7486de5daf83d/app/logical/post_replacement_processor.rb#L61-L88","documentation":"Error \"#{source_url} has multiple images. Enter the URL of a single image\" thrown in danbooru/danbooru.","triggerScenarios":"Thrown at app/logical/post_replacement_processor.rb:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enter the direct URL of a single image instead of a page or gallery containing multiple images."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"91fec095644078f87729db85d8f7486de5daf83d","analyzedAt":"2026-08-24T06:18:22.875Z","schemaVersion":2},"datasetVersion":"2026-08-24T07:17:09.176Z"}