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
  open python files in other drive akbarza 1 755 Aug-24-2023, 01:23 PM
Last Post: deanhystad
  Integrating Google Drive in App Lahearle 0 505 Jul-19-2023, 05:51 PM
Last Post: Lahearle
  code to send attachments contained on the drive. stefanoste78 1 927 Oct-12-2022, 02:16 AM
Last Post: Larz60+
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 1,862 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  Cant Access D: Drive kucingkembar 4 1,438 Jul-28-2022, 04:53 PM
Last Post: kucingkembar
  Calling exe on network drive GrahamL 4 2,657 Jan-21-2022, 12:01 PM
Last Post: GrahamL
  Failing to copy file from a network to a local drive tester_V 4 7,280 Jan-20-2021, 07:40 AM
Last Post: tester_V
  Type hinting - return type based on parameter micseydel 2 2,550 Jan-14-2020, 01:20 AM
Last Post: micseydel
  Nested Subdirectory within current sub on shared network drive Agregware 1 1,982 Jun-19-2019, 10:07 PM
Last Post: Gribouillis
  trouble with os.listdir on a network drive lconner 10 19,313 Jun-04-2019, 07:16 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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