返回排行榜

qsniyg/maxurl

JavaScriptqsniyg.github.io/maxurl/

Finds larger/original versions of images and videos

userscriptaddonimagevideodownloadbatch-downloadbatch-download-photosgalleryimage-downloadervideo-downloaderalbum-downloaderwebextension
Star 增长趋势
Star
1.6k
Forks
97
周增长
Issues
408
5001k1.5k
2018年3月2020年12月2023年10月2026年7月
制品库npmnpm install maxurl
README

Image Max URL


English | Português (Brasil)


Image Max URL is a program that will try to find larger/original versions of images and videos, usually by replacing URL patterns.

It currently contains support for >10,000 hardcoded websites (full list in sites.txt), but it also supports a number of generic engines (such as Wordpress and MediaWiki), which means it can work for many other websites as well.

It is currently released as:

  • Userscript: (most browsers)
  • Browser extension: Firefox
    • Other browsers supporting WebExtensions can sideload the extension through this git repository.
    • Since addons have more privileges than userscripts, it has a bit of extra functionality over the userscript.
    • Source code is in manifest.json and the extension folder.
  • Website
    • Due to browser security constraints, some URLs (requiring cross-origin requests) can't be supported by the website.
    • Source code is in the gh-pages branch.
  • Reddit bot (/u/MaxImageBot)

Community:

Sideloading the extension

The extension is currently unavailable to other browsers' addon stores (such as Chrome and Microsoft Edge), but you can sideload this repository if you wish to use the extension version instead of the userscript.

Tor Browser/Mullvad Browser

In order to use the extension on Tor Browser, ensure that the "Run in Private Windows" option is enabled in the about:addons page.

Due to various anti-fingerprinting measures, many of the default shortcuts (such as any that include Alt) will not work. You'll need to rebind these. Some users prefer rebinding Shift+Alt+I to Ctrl+`.

Contributing

Any contribution is greatly appreciated! If you have any bug reports, feature requests, or new websites you want supported, please file an issue here.

If you don't have a Github account, feel free to either use one of the community links above or contact me directly.

If you wish to contribute to the repository itself (code contributions, translations, etc.), please check CONTRIBUTING.md for more information.

Integrating IMU in your program

As mentioned above, userscript.user.js also functions as a node module.

var maximage = require('./userscript.user.js');

maximage(smallimage, {
  // If set to false, it will return only the URL if there aren't any special properties
  // Recommended to keep true.
  //
  // The only reason this option exists is as a small hack for a helper userscript used to find new rules,
  //  to check if IMU already supports a rule.
  fill_object: true,

  // Maximum amount of times it should be run.
  // Recommended to be at least 5.
  iterations: 200,

  // Whether or not to store to, and use an internal cache for URLs.
  // Set this to "read" if you want to use the cache without storing results to it.
  use_cache: true,

  // Timeout (in seconds) for cache entries in the URL cache
  urlcache_time: 60*60,

  // List of "problems" (such as watermarks or possibly broken image) to exclude.
  //
  // By default, all problems are excluded.
  // You can access the excluded problems through maximage.default_options.exclude_problems
  // By setting it to [], no problems will be excluded.
  //exclude_problems: [],

  // Whether or not to exclude videos
  exclude_videos: false,

  // This will include a "history" of objects found through iterations.
  // Disabling this will only keep the objects found through the last successful iteration.
  include_pastobjs: true,

  // This will try to find the original page for an image, even if it requires extra requests.
  force_page: false,

  // This allows rules that use 3rd-party websites to find larger images
  allow_thirdparty: false,

  // This is useful for implementing a blacklist or whitelist.
  //  If unspecified, it accepts all URLs.
  filter: function(url) {
    return true;
  },

  // Helper function to perform HTTP requests, used for sites like Flickr
  //  The API is expected to be like GM_xmlHTTPRequest's API.
  // An implementation using node's request module can be found in reddit-bot/dourl.js
  do_request: function(options) {
    // options = {
    //   url: "",
    //   method: "GET",
    //   data: "", // for method: "POST"
    //   overrideMimeType: "", // used to decode alternate charsets
    //   headers: {}, // If a header is null or "", don't include that header
    //   onload: function(resp) {
    //     // resp is expected to be XMLHttpRequest-like object, implementing these fields:
    //     //   finalUrl
    //     //   readyState
    //     //   responseText
    //     //   status
    //   }
    // }
  },

  // Callback
  cb: function(result) {
    if (!result)
      return;

    if (result.length === 1 && result[0].url === smallimage) {
       // No larger image was found
       return;
    }

    for (var i = 0; i < result.length; i++) {
      // Do something with the object
    }
  }
});

The result is a list of objects that contain properties that may be useful in using the returned image(s):

[{
  // The URL of the image
  url: null,

  // Whether or not this URL is a video
  video: false,

  // Whether it's expected that it will always work or not.
  //  Don't rely on this value if you don't have to
  always_ok: false,

  // Whether or not the URL is likely to work.
  likely_broken: false,

  // Whether or not the server supports a HEAD request.
  can_head: true,

  // HEAD errors that can be ignored
  head_ok_errors: [],

  // Whether or not the server might return the wrong Content-Type header in the HEAD request
  head_wrong_contenttype: false,

  // Whether or not the server might return the wrong Content-Length header in the HEAD request
  head_wrong_contentlength: false,

  // This is used in the return value of the exported function.
  //  If you're using a callback (as shown in the code example above),
  //  this value will always be false
  waiting: false,

  // Whether or not the returned URL is expected to redirect to another URL
  redirects: false,

  // Whether or not the URL is temporary/only works on the current IP (such as a generated download link)
  is_private: false,

  // Whether or not the URL is expected to be the original image stored on the website's servers.
  is_original: false,

  // If this is true, you shouldn't input this URL again into IMU.
  norecurse: false,

  // Whether or not this URL should be used.
  // If true, treat this like a 404
  // If "mask", this image is an overlayed mask
  bad: false,

  // Same as above, but contains a list of objects, e.g.:
  // [{
  //    headers: {"Content-Length": "1000"},
  //    status: 301
  // }]
  // If one of the objects matches the response, it's a bad image.
  // You can use maximage.check_bad_if(bad_if, resp) to check.
  //  (resp is expected to be an XHR-like object)
  bad_if: [],

  // Whether or not this URL is a "fake" URL that was used internally (i.e. if true, don't use this)
  fake: false,

  // Headers required to view the returned URL
  //  If a header is null, don't include that header.
  headers: {},

  // Additional properties that could be useful
  extra: {
    // The original page where this image was hosted
    page: null,

    // The title/caption attached to the image
    caption: null
  },

  // If set, this is a more descriptive filename for the image
  filename: "",

  // A list of problems with this image. Use exclude_problems to exclude images with specific problems
  problems: {
    // If true, the image is likely larger than the one inputted, but it also has a watermark (when the inputted one doesn't)
    watermark: false,

    // If true, the image is likely smaller than the one inputted, but it has no watermark
    smaller: false,

    // If true, the image might be entirely different from the one inputted
    possibly_different: false,

    // If true, the image might be broken (such as GIFs on Tumblr)
    possibly_broken: false
  }
}]
相关仓库
the1812/Bilibili-Evolved

强大的哔哩哔哩增强脚本

TypeScriptnpmOtheruserscriptbilibili
29.9k1.8k
maboloshi/github-chinese

GitHub 汉化插件,GitHub 中文化界面。 (GitHub Translation To Chinese)

JavaScriptnpmGNU General Public License v3.0githubuserscript
maboloshi.github.io/github-chinese/
29.1k1.7k
hmjz100/LinkSwift

一个基于 JavaScript 的网盘文件下载地址获取工具。基于【网盘直链下载助手】修改 ,支持 百度网盘 / 阿里云盘 / 中国移动云盘 / 天翼云盘 / 迅雷云盘 / 夸克网盘 / UC网盘 / 123云盘 八大网盘

JavaScriptnpmGNU Affero General Public License v3.0aliyun-drivebaidu
github.com/hmjz100/LinkSwift/raw/main/%EF%BC%88%E6%94%B9%EF%BC%89%E7%BD%91%E7%9B%98%E7%9B%B4%E9%93%BE%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B.user.js
18.3k1.1k
immersive-translate/immersive-translate

沉浸式双语网页翻译扩展 , 支持输入框翻译, 鼠标悬停翻译, PDF, Epub, 字幕文件, TXT 文件翻译 - Immersive Dual Web Page Translation Extension

chrome-extensionsafari-extension
immersivetranslate.com
18.2k1.1k
xcanwin/KeepChatGPT

这是一款提高ChatGPT的数据安全能力和效率的插件。并且免费共享大量创新功能,如:自动刷新、保持活跃、数据安全、取消审计、克隆对话、言无不尽、净化页面、展示大屏、拦截跟踪、日新月异、明察秋毫等。让我们的AI体验无比安全、顺畅、丝滑、高效、简洁。

JavaScriptnpmGNU General Public License v2.0chatgptai
14.9k738
JoeanAmier/XHS-Downloader

小红书(XiaoHongShu、RedNote)链接提取/作品采集工具:提取账号发布、收藏、点赞、专辑作品链接;提取搜索结果作品、用户链接;采集小红书作品信息;提取小红书作品下载地址;下载小红书作品文件

PythonPyPIGNU General Public License v3.0pythonjson
discord.com/invite/ZYtmgKud9Y
12k1.8k
fishjar/kiss-translator

A simple, open source bilingual translation extension & Greasemonkey script (一个简约、开源的 双语对照翻译扩展 & 油猴脚本)

JavaScriptnpmGNU General Public License v3.0extensiontranslation
github.com/fishjar/kiss-translator
11.4k509
XIU2/UserScript

🐵 自用的一些乱七八糟 油猴脚本~

JavaScriptnpmGNU General Public License v3.0userscriptsteam
greasyfork.org/users/457025
9.8k697
ilyhalight/voice-over-translation

Небольшое расширение, которое добавляет закадровый перевод видео из YaBrowser в другие браузеры

TypeScriptnpmMIT Licensevotvtrans
votdocs.toil.cc/ecosystem/voice-over-translation.html
7.1k433
victornpb/undiscord

Undiscord - Delete all messages in a Discord server / channel or DM (Easy and fast) Bulk delete

JavaScriptnpmOtherdiscorddelete-multiple
victornpb.github.io/undiscord
6.6k780
itorr/nbnhhsh

😩「能不能好好说话?」 拼音首字母缩写翻译工具

JavaScriptnpmApache License 2.0javascriptuserscript
lab.magiconch.com/nbnhhsh/
6.3k241
Neet-Nestor/Telegram-Media-Downloader

A script allowing you to download images and videos from Telegram web even if the group restricts downloading.

JavaScriptnpmGNU General Public License v3.0greasyforkgreasymonkey
greasyfork.org/scripts/446342-telegram-media-downloader
5k495