Greasy Fork

Greasy Fork is available in English.

Flickr WideScreen BigONE - HI-RES Pics v.8

Higher resolution shots (by NotYou and DuckDuckGo IA) - TEST For WIDE BLURRY in Pool Classic View Justified (just Few wide images Fail)

当前为 2025-03-15 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Flickr WideScreen BigONE -  HI-RES Pics v.8
// @description  Higher resolution shots (by NotYou and DuckDuckGo IA) - TEST For WIDE BLURRY in Pool Classic View Justified (just Few wide images Fail)
// @version      9.0
// @author       decembre
// @namespace    http://greasyfork.icu/fr/users/8-decembre
// @icon         https://external-content.duckduckgo.com/ip3/blog.flickr.net.ico

// @match      https://www.flickr.com/groups_pool.gne*
// @match      https://www.flickr.com/groups/*
// @match      https://www.flickr.com/notifications
// @match      https://www.flickr.com/search/*
// @match      https://www.flickr.com/photosof/*
// @match      https://www.flickr.com/photos/*/archives/*


// @include      https://www.flickr.com/groups_pool.gne*
// @include      https://www.flickr.com/groups/*
// @include      https://www.flickr.com/notifications
// @include      https://www.flickr.com/search/*
// @include      https://www.flickr.com/photosof/*
// @include      https://www.flickr.com/photos/*/archives/*

// @require https://code.jquery.com/jquery-3.6.0.min.js
// @grant GM_addStyle
// ==/UserScript==

(function() {
  var $ = window.jQuery;

  // FLICKR 1 - POOL SMALL (SCR)
  // #pool-photos.sm .thumb img:not(.video-play-icon)[src$="_t.jpg"]
  (function() {
    document.querySelectorAll('#pool-photos.sm .thumb img:not(.video-play-icon)[src$="_t.jpg"]').forEach(elem => {
      if(elem.tagName.toLowerCase() === 'source') {
        const newSrcset = elem.srcset.replace(/\_t\.jpg$/, getNewSource);

        elem.srcset = newSrcset;
      } else {
        const newSource = elem.src.replace(/\_t\.jpg$/, getNewSource);

        elem.src = newSource;
      }

      function getNewSource(m) {
        const indexOfDot = m.indexOf('.')
        const fileExtenstion = m.slice(indexOfDot)
        const fileName = m.slice(0, indexOfDot)

        return fileName.replace('t', 'w') + fileExtenstion
      }

    });

  })();

 // FLICKR 2A - Pool Classic View - JUSTIFIED VIEW (for large blurry image) T to Z -
(function() {
  console.log('Starting justified view image modification...');
  try {
    const modifiedElements = new Set();
    let timeoutId = null;
    const observer = new MutationObserver((mutations) => {
      const elements = document.querySelectorAll('.ju.photo-display-container .pool-photo.photo-display-item .photo_container.pc_t img[src$="_t.jpg"]');
      elements.forEach((elem) => {
        if (!modifiedElements.has(elem)) {
          console.log('Modifying element:', elem);
          const newSource = elem.src.replace(/\_t\.jpg$/, '_z.jpg');
          elem.src = newSource;
          elem.classList.add('HDW');
          console.log('Modified image source:', newSource);
          modifiedElements.add(elem);
        }
      });
      clearTimeout(timeoutId);
      timeoutId = setTimeout(() => {
        observer.disconnect();
        console.log('No new modifications arrived. Stopping observer.');
      }, 5000);
    });
    observer.observe(document, {
      childList: true,
      subtree: true,
    });
  } catch (error) {
    console.error('Error modifying justified view images:', error);
  }
})();

// FLICKR 3 - NOTIFICATIONS PAGES VIEW (BACK IMG)
    //style="background-image: url(//live.staticflickr.com/65535/49726613923_022f7fb3c2_t.jpg);"
    // style="background-image: url(//live.staticflickr.com/65535/49726613923_022f7fb3c2_b.jpg);"
(function() {
  console.log('Code exécuté');
  var observer = new MutationObserver(function(mutations) {
    var elements = document.querySelectorAll('html.fluid.html-notification-center-page-view .notification-center-page-view .notification-item .thumb-container a.notification-photo-thumb');
    if (elements.length > 0) {
      console.log('Éléments trouvés !');
      elements.forEach(function(elem) {
        var style = elem.style.backgroundImage;
        if (style && style.indexOf('_t.jpg') !== -1) {
          console.log('Background trouvé : ' + style);
          var newStyle = style.replace('_t.jpg', '_b.jpg');
          elem.style.backgroundImage = newStyle;
          console.log('Background modifié : ' + newStyle);
          elem.classList.add('HD');
        } else {
          console.log('Pas de background trouvé pour l\'élément : ' + elem);
        }
      });
    }
  });
  observer.observe(document, {
    childList: true,
    subtree: true
  });
})();

// FLICKR 4 - SEARCH PAGES (BACK IMG)
    // .fluid.html-search-photos-unified-page-view main#search-unified-content.main.fluid-centered
(function() {
  console.log('Code exécuté');
  var observer = new MutationObserver(function(mutations) {
    var elements = document.querySelectorAll('.fluid.html-search-photos-unified-page-view main#search-unified-content.main.fluid-centered .search-container-w-sidebar .main.search-photos-results .search-photos-everyone-view .photo-list-view .photo-list-tile-view.forced-aspect-ratio .photo');
    if (elements.length > 0) {
      console.log('Éléments trouvés !');
      elements.forEach(function(elem) {
        var style = elem.style.backgroundImage;
        if (style && style.indexOf('_m.jpg') !== -1) {
          console.log('Background trouvé : ' + style);
          var newStyle = style.replace('_m.jpg', '_c.jpg');
          elem.style.backgroundImage = newStyle;
          console.log('Background modifié : ' + newStyle);
          elem.classList.add('HD');
        } else if (style && style.indexOf('_c.jpg') === -1) {
          console.log('Pas de background trouvé pour l\'élément : ' + elem);
          // Essayez de modifier l'élément à nouveau après un certain délai
          setTimeout(function() {
            var newStyle = elem.style.backgroundImage.replace('_m.jpg', '_c.jpg');
            elem.style.backgroundImage = newStyle;
            console.log('Background modifié : ' + newStyle);
            elem.classList.add('HD');
          }, 1000);
        }
      });
    }
  });
  observer.observe(document, {
    childList: true,
    subtree: true
  });
})();


// FLICKR 5 - Photo OF (SRC) (BACK IMG)
    // .HoldPhotos p.RecentPhotos .photo_container a img:not(.video-play-icon)[src$="_t.jpg"]
    //  src="https://live.staticflickr.com/4086/35707812856_5b19db2991_t.jpg"
(function() {
    document.querySelectorAll('.HoldPhotos p.RecentPhotos .photo_container a img:not(.video-play-icon)[src$="_t.jpg"]').forEach(elem => {
      if(elem.tagName.toLowerCase() === 'source') {
        const newSrcset = elem.srcset.replace(/\_t\.jpg$/, getNewSource);

        elem.srcset = newSrcset;
      } else {
        const newSource = elem.src.replace(/\_t\.jpg$/, getNewSource);

        elem.src = newSource;
          elem.classList.add('HD');
      }

      function getNewSource(m) {
        const indexOfDot = m.indexOf('.')
        const fileExtenstion = m.slice(indexOfDot)
        const fileName = m.slice(0, indexOfDot)

        return fileName.replace('t', 'w') + fileExtenstion
      }

    });

  })();

// FLICKR 6 - POOL Clasique - Defered Images
(function() {
  function updateDeferredImages() {
    document.querySelectorAll('.super-liquid #pool-photos.photo-display-container.ju .pc_img.defer.img').forEach(elem => {
      if (elem.src === "https://combo.staticflickr.com/pw/images/spaceout.gif" && elem.dataset.deferSrc) {
        elem.src = elem.dataset.deferSrc;
      }
    });
  }

  updateDeferredImages();

  // Relancer la fonction après 500ms
  setInterval(updateDeferredImages, 500);
})();

// FLICKR 7 - GROUP POOL SMALL (SCR) -after ckick direct - (Not in Tampermonkey?)
// .fluid.html-group-pool-page-view .group-pool-subheader-view:not(.requiredToShowOnServer) + .photo-list-view:not(.requiredToShowOnServer) .photo-list-photo-view.awake .photo-list-photo-container img:not(.video-play-icon)
  (function() {
    document.querySelectorAll('.fluid.html-group-pool-page-view .group-pool-subheader-view + .photo-list-view .photo-list-photo-view.awake .photo-list-photo-container img:not(.video-play-icon)[src$="_t.jpg"]').forEach(elem => {
      if(elem.tagName.toLowerCase() === 'source') {
        const newSrcset = elem.srcset.replace(/\_t\.jpg$/, getNewSource);

        elem.srcset = newSrcset;
      } else {
        const newSource = elem.src.replace(/\_t\.jpg$/, getNewSource);

        elem.src = newSource;
      }

      function getNewSource(m) {
        const indexOfDot = m.indexOf('.')
        const fileExtenstion = m.slice(indexOfDot)
        const fileName = m.slice(0, indexOfDot)

        return fileName.replace('t', 'w') + fileExtenstion
      }

    });

  })();

// FLICKR 8 - ARCHIVES SMALL (SCR)
  // #archives.sm .archive .thumb span.photo_container a.rapidnofollow:not(.spaceball) img:not(.video-play-icon):not(.video-play-icon)[src$="_t.jpg"]
  (function() {
    document.querySelectorAll('#archives.sm .archive .thumb span.photo_container a.rapidnofollow:not(.spaceball) img:not(.video-play-icon):not(.video-play-icon)[src$="_t.jpg"]').forEach(elem => {
      if(elem.tagName.toLowerCase() === 'source') {
        const newSrcset = elem.srcset.replace(/\_t\.jpg$/, getNewSource);

        elem.srcset = newSrcset;
      } else {
        const newSource = elem.src.replace(/\_t\.jpg$/, getNewSource);

        elem.src = newSource;
      }

      function getNewSource(m) {
        const indexOfDot = m.indexOf('.')
        const fileExtenstion = m.slice(indexOfDot)
        const fileName = m.slice(0, indexOfDot)

        return fileName.replace('t', 'w') + fileExtenstion
      }

    });

  })();

  // Ajout de CSS pour supprimer la bordure
  $ ('head').append(`
    <style type='text/css'>
    /* SMALL VIEW */
       /*#pool-photos.sm .thumb img:not(.video-play-icon)[src$="_w.jpg"]{
        border: 1px dashed aqua  !important;
      }*/
      /* JUSTIFIED VIEW - BLURRY IMAG */
      /*.ju.photo-display-container .pool-photo.photo-display-item [src$="_b.jpg"] {
        border: 1px dotted aqua  !important;
      }*/
    </style>
  `);
})();