Skip to content

Instantly share code, notes, and snippets.

@davFaithid
Last active June 3, 2026 17:33
Show Gist options
  • Select an option

  • Save davFaithid/eb080b8fd29accc2735c459970729913 to your computer and use it in GitHub Desktop.

Select an option

Save davFaithid/eb080b8fd29accc2735c459970729913 to your computer and use it in GitHub Desktop.
Download Netflix, Amazon, and Hulu Images
Here because I don't want the gist to be titled .gitignore lol
chromedriver.exe
*.jpeg
*.png
*.jpg

Download Metadata Images from streaming sites like Netflix, Amazon, and Hulu (more coming soon!)

Service Status
Netflix Implemented
Hulu Partially*
Amazon Implemented

syntax:

py -3 <service>.py <url>

ie

py -3 netflix.py https://www.netflix.com/title/80217478

which downloads this background and this logo

*Cannot Download Hulu Backgrounds, and certain metadata for TV Shows are unavailable.

#Created by davFaithid on Friday 5/29/2020
#Please credit me if you use this in another project
#Thank you
import sys, os, time
from urllib.request import urlopen, urlretrieve, Request
import re
from bs4 import BeautifulSoup
from selenium import webdriver
from os import path
if path.exists("chromedriver.exe") == False:
print("chromedriver needed in folder with scripts")
import webbrowser
webbrowser.open("https://sites.google.com/a/chromium.org/chromedriver/downloads")
sys.exit()
else:
pass
url = str(sys.argv[1]).strip()
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
#Causes the site to crash
#options.add_argument('--incognito')
#options.add_argument('--headless')
driver = webdriver.Chrome(options=options)
driver.get(url)
html_page = driver.page_source
soup = BeautifulSoup(html_page, features="html.parser")
year = str(soup.find("span", {"data-automation-id":"release-year-badge"}).text)
rating = str(soup.find("span", {"data-automation-id":"rating-badge"}).text).replace('<span class="">','').replace('</span>','')
description = str(soup.find("div", {"class":"_3qsVvm _1wxob_"}).text)
name = str(soup.find("h1", {"data-automation-id":"title"}).text)
print("""
Title: """,name,"""
Rating: """,rating,"""
Year: """,year,"""
Description:
"""+description,"""
""")
name = re.sub('[^A-Za-z0-9 ]+', '', name)
burl = str(soup.find("img", {"class":"_1fk85K"}).get("src"))
print("Downloading background @",burl)
background = str(str(name) + "-landscape.jpeg")
urlretrieve(burl, background)
driver.close()
driver.quit()
sys.exit()
#Created by davFaithid on Sunday 5/31/2020
#Please credit me if you use this in another project
#Thank you
import sys, os, time
from urllib.request import urlopen, urlretrieve, Request
import re
from bs4 import BeautifulSoup
url = str(sys.argv[1]).strip()
req = Request(
url,
data=None,
headers={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0'
}
)
html_page = urlopen(req)
soup = BeautifulSoup(html_page, features="html.parser")
details = str(soup.find("div", {"class":"DetailEntityMasthead__tags"}).text)
description = str(soup.find("p", {"class":"DetailEntityMasthead__description"}).text)
#name = str(soup.find("img", {"role":"presentation"}).get("alt"))
try:
name = str(soup.find("span", {"class":"DetailEntityMasthead__title__text"}).text)
except AttributeError:
name = "Name is unavailable"
print("""
Title: """,name,"""
Details: """,details,"""
Description:
"""+description,"""
""")
name = re.sub('[^A-Za-z0-9 ]+', '', name)
"""
Need to find how to get background
print("Downloading background @",burl)
background = str(str(name) + "-landscape.jpeg")
urlretrieve(burl, background)
"""
poster = str(str(name) + "-poster.jpeg")
purl = soup.find("img", {"class":"DetailEntityMasthead__vertical-tile-img"}).get("src")
print("Downloading poster @",purl)
urlretrieve(purl, poster)
logo = str(str(name) + "-logo.png")
try:
lurl = soup.find("img", {"role":"presentation","srcset":re.compile('&size=690x138|max&format=png 2x')}).get("src")
print("Downloading logo @",lurl)
urlretrieve(lurl, logo)
except AttributeError:
print("Logo not available")
"""
###This also works =)
script = soup.find("script", {"type":"application/ld+json"})
print(script)
if script:
import json
jsondata = json.loads(script.text)
url2 = jsondata["image"]
urlretrieve(url2, 'pic.jpg')
"""
#Created by davFaithid on Saturday 5/23/2020
#Please credit me if you use this in another project
#Thank you
import sys, os, time
from urllib.request import urlopen, urlretrieve, Request
import re
from bs4 import BeautifulSoup
url = str(sys.argv[1]).strip()
req = Request(
url,
data=None,
headers={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0'
}
)
html_page = urlopen(req)
links = []
soup = BeautifulSoup(html_page, features="html.parser")
year = str(soup.find("span", {"class":"title-info-metadata-item item-year"}).text)
rating = str(soup.find("span", {"class":"maturity-number"}).text)
description = str(soup.find("div", {"class":"title-info-synopsis"}).text)
name = str(soup.find("h1", {"class":"title-title"}).text)
print("""
Title: """,name,"""
Rating: """,rating,"""
Year: """,year,"""
Description:
"""+description,"""
""")
name = re.sub('[^A-Za-z0-9 ]+', '', name)
for mydivs in soup.findAll("div", {"class": "hero-image hero-image-desktop"}):
links.append(mydivs.get('style'))
burl = str(links[0]).replace('display:none;background-image:url("', '').replace('")','')
print("Downloading background @",burl)
background = str(str(name) + "-landscape.jpeg")
urlretrieve(burl, background)
logo = str(str(name) + "-logo.jpeg")
lurl = soup.find("img", {"class":"logo", "data-uia":"title-logo"}).get("src")
print("Downloading logo @",lurl)
urlretrieve(lurl, logo)
"""
###This also works =)
script = soup.find("script", {"type":"application/ld+json"})
print(script)
if script:
import json
jsondata = json.loads(script.text)
url2 = jsondata["image"]
urlretrieve(url2, 'pic.jpg')
"""
@davFaithid

davFaithid commented May 24, 2020

Copy link
Copy Markdown
Author

Example:

py -3 netflix.py https://www.netflix.com/title/215309

Title:                 Ace Ventura: Pet Detective
Rating:                PG-13
Year:                  1994
Description:
Barely competent pet private eye Ace Ventura is put on the case when kidnappers with an ax to grind abduct Snowflake, the Miami Dolphins' mascot.

Downloading background @ https://occ-0-3934-3933.1.nflxso.net/dnm/api/v6/6AYY37jfdO6hpXcMjf9Yu5cnmO0/AAAABbUbUudEMnqi1TxkF92zx26nIp2P73gHySk30G90zf6uMMW55PlFGsKD0q5MizMO6i6RS5wg3xAlBe7YfM_xUhDxN2Wz.jpg?r=349
Downloading logo @ https://occ-0-3934-3933.1.nflxso.net/dnm/api/v6/TsSRXvDuraoJ7apdkH6tsHhf-ZQ/AAAABSVchx0RRxQOvW1rK4dvjJEsnCqNn9Irl8thtzjcqXweeEWA4Yn6YEEBfaTwBhVm8LdX44WGWFhuWMjew2OCAC0L5eMZpZnVIExb.png?r=8e3
py -3 amazon.py https://www.amazon.com/gp/video/detail/B07VCVGG5W

DevTools listening on ws://127.0.0.1:61570/devtools/browser/f33b58d0-0b74-4baa-8e94-02cd9cb16b4f

Title:                 Pokémon Detective Pikachu + Bonus Features
Rating:                PG
Year:                  2019
Description:
When an ace detective goes missing, his son teams up with a hilariously wise-cracking Pokémon - Detective Pikachu (Ryan Reynolds) - to help solve the mystery of what happened.

Downloading background @ https://images-na.ssl-images-amazon.com/images/S/sgp-catalog-images/region_US/wb-2082372_6000124934-Full-Image_GalleryBackground-en-US-1566321407432._SX1080_.jpg
py -3 hulu.py https://www.hulu.com/movie/parasite-2fd691a0-f66b-467f-8635-00d7f151f3d4

Title:                 Parasite
Details:               R • Comedy, Drama, Thriller, Horror, International, Korean • Movie • 2019
Description:
Greed, class discrimination, and a mysterious interloper threaten the newly formed symbiotic relationship between the wealthy Park family and the dest...more

Downloading poster @ https://img.hulu.com/user/v3/artwork/2fd691a0-f66b-467f-8635-00d7f151f3d4?base_image_bucket_name=image_manager&base_image=3388e2a5-989d-4488-ba59-8f1e2de8832c&size=400x600&format=jpeg
Downloading logo @ https://img.hulu.com/user/v3/artwork/2fd691a0-f66b-467f-8635-00d7f151f3d4?base_image_bucket_name=image_manager&base_image=7950e659-83e2-40eb-8811-2a9149c08f23&size=345x69|max&format=png

@Azuriru

Azuriru commented May 18, 2026

Copy link
Copy Markdown

Hey. I think the netflix one is no longer working sadly.

~\Code\ninx> py -3 n.py https://www.netflix.com/title/80217478
Traceback (most recent call last):
  File "C:\Users\Robyn\Code\ninx\n.py", line 21, in <module>
    year = str(soup.find("span", {"class":"title-info-metadata-item item-year"}).text)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'text'
~\Code\ninx> ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment