5

When you look at any IMDB image page, the movie poster image has a url of this form:

http://ia.media-imdb.com/images/M/MV5BMTIxOTY1NjUyN15BMl5BanBnXkFtZTcwMjMxMDk1MQ@@._V1_SX214_AL_.jpg

or more generally:

http://ia.media-imdb.com/images/M/<alphaNumeric>@@.\_V1\_SX214\_AL_.jpg

I want to know how that alphaNumeric is generated, most likely from either the title of the movie or from the IMDB code.

Two examples (though many more can be found by browsing IMDB) are for Kung Fu Panda:

I've made some progress, seeing as the AlphaNumeric is Base64 encoded (the first one becomes 1^A1219656527^A2^Ajpg^Ame702310951), or at least I'm pretty sure based off of the 'jpg' text. However, I'm not sure how the numbers after the first ^A and the last ^Ame are generated. If anyone can find a relationship between the movies or their IMDB codes and those numbers, that would be fantastic!

  • 1219656527 looks like a unix timestamp for the date 2008-08-25 11:28:47. No idea for the rest. – Celelibi Dec 11 '14 at 14:54
  • @Celelibi unfortunately, if you do the same process for the second, you get the date 2029-08-15 8:01:16. Which doesn't seems as likely. – Alex Beals Dec 16 '14 at 4:50
  • indeed, 2029 is a bit far away. No idea then. – Celelibi Dec 16 '14 at 6:43
3

I tried to decode the "AlphaNumeric" string for each movie in the Top 250 Chart.

Looks like they replaced the padding symbol (they use '@' instead of '=') but, once I restored the padding, every decoded string had the same format you reported before (I will use commas, instead of '^A', as field separators):

1, [numeric value], 2, jpg, me + [numeric value]

I failed to identify any relationships between those numeric fields and the movie IDs, but here is some code for those willing to try:

import requests
import re
from lxml.etree import HTML
from matplotlib import pyplot as plt
import numpy

request = requests.get('http://www.imdb.com/chart/top?ref_=nv_ch_250_4')
tree = HTML(request.text)
path = './/*[@id="main"]/div/div[2]/table/tbody/tr/td[@class="posterColumn"]/a'
data = numpy.zeros(shape=(250, 3))
row = 0
for td in tree.findall(path):
    movie_id = re.findall('tt(\d*)/', td.attrib['href'])
    img = re.findall('M/(.*)\._V', td.find('./img').attrib['src'])
    img_decoded = img.pop().replace('@', '=').decode('base64')
    img_field_1 = re.findall('\^A(\d*)\^A', img_decoded)
    img_field_2 = re.findall('me(\d*)', img_decoded)
    data[row] = movie_id.pop(), img_field_1.pop(), img_field_2.pop()
    row += 1

fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True)
ax1.scatter(data[:, 0], data[:, 1])  # movie_id vs. img_field_1
ax2.scatter(data[:, 0], data[:, 2])  # movie_id vs. img_field_2
ax1.xaxis.get_major_formatter().set_powerlimits((0, 1))

Here is a small plot showing both decoded fields vs. movie IDs:

Decoded fields vs. Movie IDs

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.