Python Forum
How to get a removable disc type in drive
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get a removable disc type in drive
#3
(Feb-06-2024, 05:45 AM)Daring_T Wrote: I am currently working on a program to automate ripping and backing my collection of CDs, DVDs and Blue-rays. I am currently running into an issue where I need to be able to find the type of disc in the drive but I have been unable to located a library that can do so. Has anymore ran into this issue before and if so what was your solution? The only janky way I'm seeing is by looking at Blue-rays and DVDs file structure. For DVD its TS_Video and or TS_Audio. For Blue-ray its AACS, BDMV and CERTIFICATE and go by that and for CD I have an bash command like abcde and catch if it fails or succeeds . Also if this help's I am writing this under Linux. If you have any suggestions or another way of looking at this please let me know.

Thanks,
Daring_T

It seems like you're on the right track with your approach, but there might be a more straightforward way to determine the type of disc in the drive programmatically, especially under Linux.

One common method is to use the blkid command, which is typically used to locate/block device attributes like UUIDs or filesystem types. When a disc is inserted into the drive, it should register as a block device, and blkid can provide information about it.

$blkid

This command should list all block devices, including optical drives and their respective filesystems. By parsing the output of this command, you can determine the type of disc inserted.

Best Regard
Danish Hafeez | QA Assistant
Gribouillis likes this post
Reply


Messages In This Thread
RE: How to get a removable disc type in drive - by Danishhafeez - Feb-06-2024, 11:15 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Create dual folder on different path/drive based on the date agmoraojr 2 1,443 Jan-21-2024, 10:02 AM
Last Post: snippsat
  open python files in other drive akbarza 1 1,575 Aug-24-2023, 01:23 PM
Last Post: deanhystad
  Integrating Google Drive in App Lahearle 0 1,117 Jul-19-2023, 05:51 PM
Last Post: Lahearle
  code to send attachments contained on the drive. stefanoste78 1 1,685 Oct-12-2022, 02:16 AM
Last Post: Larz60+
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 2,975 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  Cant Access D: Drive kucingkembar 4 2,794 Jul-28-2022, 04:53 PM
Last Post: kucingkembar
  Deploy Python to Cloud and save output to Google Drive chandrabr80 2 2,529 Jan-25-2022, 06:56 AM
Last Post: ndc85430
  Calling exe on network drive GrahamL 4 4,143 Jan-21-2022, 12:01 PM
Last Post: GrahamL
  string.format() suddenly causing errors with google drive API zwitrader 0 2,438 Jun-28-2021, 11:38 PM
Last Post: zwitrader
  Failing to copy file from a network to a local drive tester_V 4 10,575 Jan-20-2021, 07:40 AM
Last Post: tester_V

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020