Imgur Direct Images

Direct images on Imgur including albums

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

作者のサイトでサポートを受ける。または、このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Imgur Direct Images
// @version      1.0.1
// @description  Direct images on Imgur including albums
// @namespace    https://github.com/AbdurazaaqMohammed
// @author       Abdurazaaq Mohammed
// @license      The Unlicense
// @homepage     https://github.com/AbdurazaaqMohammed/userscripts
// @supportURL   https://github.com/AbdurazaaqMohammed/userscripts/issues
// @match        https://imgur.com/*
// @exclude      https://imgur.com/
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
  'use strict';

  const url = window.location.href;

  if(url.includes('/a/')) {
             // Try to clean the crap. If you try to hide all elements imgur will redirect to the homepage for some reason.
             document.head.appendChild(document.createElement('style')).innerHTML = 'a:not(.Gallery-Content--media) { display: none !important; } *{ background-color: black !important; }';
             const intervalID = setInterval(function() {


        const images = document.querySelectorAll('.Gallery-Content--media img');
        if(images[0]) {
          const links = [];
          clearInterval(intervalID);
          images.forEach(image => {
            const directLink = image.src.split('?')[0].replace('_d.', '.'); //_d is a lower quality image.
            if(!links.includes(directLink)) links.push(directLink); // For some reason it shows all links twice.
          });
          window.location.href = 'https://abdurazaaqmohammed.github.io/website/imgviewer?viewimg=' + links.join(',');
        }
    }, 200);
  } else {
    window.location.href = url.replace('imgur', 'i.imgur') + '.jpg'; // It always works even if it's not a jpg.
  }
})();