TMDB search IDs

Show TMDB IDs in TMDB search

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        TMDB search IDs
// @description Show TMDB IDs in TMDB search
// @namespace   Violentmonkey Scripts
// @match       https://www.themoviedb.org/search
// @grant       none
// @version     1.0
// @author      SH3LL
// ==/UserScript==


let myblocks=document.getElementsByClassName("card v4 tight");
for(let currblock of myblocks){
  // get ID
  let content_id=currblock.children[0].children[0].children[0].children[0].href.replace("https://www.themoviedb.org/tv/","").replace("https://www.themoviedb.org/movie/","")

  // craft label
  let mylabel=document.createElement("label");
  mylabel.style.color="red";
  mylabel.style.fontWeight="bold";
  mylabel.style.fontSize="20px";
  mylabel.innerText=content_id;

  // append label
  currblock.children[0].children[1].children[0].children[0].append(mylabel);
}