Skip to main content

A pure Python implementation of the Windows API IDvdInfo2::GetDiscID method, as used by Windows Media Center to compute a 'practically unique' 64-bit CRC for metadata retrieval.

Project description

Travis badge Coveralls badge Scrutinizer badge

Overview

pydvdid is a pure Python implementation of the Windows API IDvdInfo2::GetDiscID method, as used by Windows Media Center to compute a ‘practically unique’ 64-bit CRC for metadata retrieval.

Motivation

I needed a zero-knowledge way to recover some basic information about an inserted DVD or a mounted ISO image, and whilst googling ran across dvdid. A compiled solution didn’t fit with my requirement, so I re-implemented it as a Python module. Kudos go to Christopher Key for originally developing dvdid and documenting the algorithm so thoroughly.

pydvdid is envisaged to be useful for DVD ripping scripts, custom Growl notifications, and media centre related home automation tasks.

Compatibility

Works for Python versions 2 and 3, from 2.6 through to the nightly build.

Availability

Get it from PyPI or directly from GitHub.

PyPI:

PyPI status PyPI version PyPI format PyPI python versions

pip install pydvdid

GitHub:

Releases

Examples

From the shell:

steve@babbage:~$ crc64=$(pydvdid /mnt/dvd)
steve@babbage:~$ echo $crc64
6e23e6a41a154405
steve@babbage:~$ curl --get http://metaservices.windowsmedia.com/pas_dvd_B/template/GetMDRDVDByCRC.xml?CRC=$crc64
<?xml version='1.0' encoding="UTF-8" ?><METADATA xmlns:sql="urn:schemas-microsoft-com:xml-sql">

    <MDR-DVD><version>4.0</version><dvdTitle>LEGO Star Wars: The Padawan Menace [French] [Blu-ray/DVD]</dvdTitle><studio>20th Century Fox Home Entertainment (Canadian</studio><leadPerformer></leadPerformer><actors></actors><director></director><MPAARating></MPAARating><releaseDate>2012 02 07</releaseDate><genre>Science Fiction</genre><dataProvider>AMG</dataProvider><wmid_dvd>7DDE9379-18E0-446A-8214-BCD3D573A54A</wmid_dvd><dv_id>E   278184          </dv_id><dataProviderParams>Provider=AMG</dataProviderParams><dataProviderLogo>Provider=AMG</dataProviderLogo><moreInfoParams></moreInfoParams><title><titleNum>1</titleNum><titleTitle>LEGO Star Wars: The Padawan Menace [French] [Blu-ray/DVD]</titleTitle><studio>20th Century Fox Home Entertainment (Canadian</studio><director></director><leadPerformer></leadPerformer><actors></actors><MPAARating></MPAARating><genre>Science Fiction</genre><providerRating></providerRating><communityRating></communityRating></title></MDR-DVD>
</METADATA>

From Python:

pydvdid has a decidely simple API, with the important bits imported into the package level so they can be conveniently imported directly from the package.

>>> from pydvdid import compute
>>> crc64 = compute("/mnt/dvd")
>>> str(crc64)
'a5acf20f2e56954b'
>>> from urllib import urlopen
>>> urlopen("http://metaservices.windowsmedia.com/pas_dvd_B/template/GetMDRDVDByCRC.xml?CRC={0}".format(crc64)).read()
'<?xml version=\'1.0\' encoding="UTF-8" ?><METADATA xmlns:sql="urn:schemas-microsoft-com:xml-sql">\r\n\t\r\n\t<MDR-DVD><version>4.0</version><dvdTitle>Room on the Broom</dvdTitle><studio>N Circle Entertainment</studio><leadPerformer>Gillian Anderson; Rob Brydon; Martin Clunes; Sally Hawkins; Simon Pegg; Timothy Spall</leadPerformer><actors>Gillian Anderson; Rob Brydon; Martin Clunes; Sally Hawkins; Simon Pegg; Timothy Spall</actors><director>Jan Lachauer; Max Lang</director><MPAARating></MPAARating><releaseDate>2013 08 06</releaseDate><genre>Children&apos;s/Family</genre><largeCoverParams>cov150/drv600/v691/v69118k4p4h.jpg</largeCoverParams><smallCoverParams>cov075/drv600/v691/v69118k4p4h.jpg</smallCoverParams><dataProvider>AMG</dataProvider><wmid_dvd>E568D84B-4CB8-4296-8896-716DDCFA1458</wmid_dvd><dv_id>E   303360          </dv_id><dataProviderParams>Provider=AMG</dataProviderParams><dataProviderLogo>Provider=AMG</dataProviderLogo><moreInfoParams></moreInfoParams><title><titleNum>1</titleNum><titleTitle>Room on the Broom</titleTitle><studio>N Circle Entertainment</studio><director>Jan Lachauer; Max Lang</director><leadPerformer>Gillian Anderson; Rob Brydon; Martin Clunes; Sally Hawkins; Simon Pegg; Timothy Spall</leadPerformer><actors>Gillian Anderson; Rob Brydon; Martin Clunes; Sally Hawkins; Simon Pegg; Timothy Spall</actors><MPAARating></MPAARating><genre>Children&apos;s/Family</genre><providerRating></providerRating><communityRating></communityRating><chapter><chapterNum>1</chapterNum><chapterTitle>Scene One [4:47]</chapterTitle></chapter><chapter><chapterNum>2</chapterNum><chapterTitle>Scene Two [7:29]</chapterTitle></chapter><chapter><chapterNum>3</chapterNum><chapterTitle>Scene Three [4:31]</chapterTitle></chapter><chapter><chapterNum>4</chapterNum><chapterTitle>Scene Four [9:55]</chapterTitle></chapter></title></MDR-DVD>\r\n</METADATA>'

License

Apache License, Version 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydvdid-1.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydvdid-1.1-py2.py3-none-any.whl (11.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pydvdid-1.1.tar.gz.

File metadata

  • Download URL: pydvdid-1.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydvdid-1.1.tar.gz
Algorithm Hash digest
SHA256 a3494f2bdab325de1e1f3441af134f8c3c287c0aa3a54d4acbfa857900e9d8d9
MD5 3948b5b84fcbdf21a9c73a12b596fabb
BLAKE2b-256 8b3e53805279c7c3e2388a7f2acd86562e6e109e1c03b16f11d9323c0ea83245

See more details on using hashes here.

File details

Details for the file pydvdid-1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pydvdid-1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0a3422635408a4155dccf5261b9e1e360ae3d882d56b232df4f7b18e73ad0c77
MD5 d9825b33d027b52ab4f609f78909d97e
BLAKE2b-256 df9a7efca6e9fc14186d08213d5d07e7f2b8d1155d853518bc28ee64c8b3d8f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page