|
32 | 32 | # check if dvd is scrambled
|
33 | 33 | if dvdcss.is_scrambled():
|
34 | 34 | print("The DVD is scrambled!")
|
35 |
| - |
| 35 | + |
36 | 36 | # read volume id from sector 16
|
37 | 37 | dvdcss.seek(16) # seek to sector 16
|
38 | 38 | dvdcss.read(1) # read only one sector
|
39 | 39 | data = dvdcss.buffer # access the latest read data
|
40 | 40 | volume_label = data[40:72].strip().decode()
|
41 | 41 | print(f"{dev}: {volume_label}")
|
42 | 42 | # >> eg. `'/dev/sr0: THE_IT_CROWD_DISC_1'`
|
43 |
| - |
| 43 | + |
44 | 44 | # make sure you dispose when your done if you didn't
|
45 | 45 | # use `with`, otherwise stuff will get stuck in memory.
|
46 | 46 | # usage of `with` on pydvdcss automatically handles disposing.
|
|
103 | 103 | cd pydvdcss
|
104 | 104 | python -m pip install --user .
|
105 | 105 |
|
106 |
| -*Note: with the second method you will need to handle updating yourself by re-cloning and installing it again.* |
| 106 | +_Note: with the second method you will need to handle updating yourself by re-cloning and installing it again._ |
107 | 107 |
|
108 | 108 | <p> </p><p> </p>
|
109 | 109 |
|
110 | 110 | # To-do
|
111 | 111 |
|
112 |
| -- [X] Implement dvdcss_open |
113 |
| -- [X] Implement dvdcss_close |
114 |
| -- [X] Implement dvdcss_seek |
115 |
| -- [X] Implement dvdcss_read |
116 |
| -- [X] Implement dvdcss_error |
117 |
| -- [X] Implement dvdcss_is_scrambled |
118 |
| -- [X] Implement `__enter__` and `__exit__` for proper disposing |
119 |
| -- [X] Add handlers for failed find_library calls |
120 |
| -- [X] Add instructions for installing libdvdcss |
121 |
| -- [X] Add and test support for Windows |
122 |
| -- [X] Add and test support for Mac OS |
123 |
| -- [X] Add and test support for Linux |
124 |
| -- [ ] Implement dvdcss_readv |
125 |
| -- [ ] Add handlers for failed cdll calls |
126 |
| -- [ ] Add function to set DVDCSS_VERBOSE |
127 |
| -- [ ] Add function to set DVDCSS_METHOD |
| 112 | +- [x] Implement dvdcss_open |
| 113 | +- [x] Implement dvdcss_close |
| 114 | +- [x] Implement dvdcss_seek |
| 115 | +- [x] Implement dvdcss_read |
| 116 | +- [x] Implement dvdcss_error |
| 117 | +- [x] Implement dvdcss_is_scrambled |
| 118 | +- [x] Implement `__enter__` and `__exit__` for proper disposing |
| 119 | +- [x] Add handlers for failed find_library calls |
| 120 | +- [x] Add instructions for installing libdvdcss |
| 121 | +- [x] Add and test support for Windows |
| 122 | +- [x] Add and test support for Mac OS |
| 123 | +- [x] Add and test support for Linux |
| 124 | +- [x] Add function to set DVDCSS_VERBOSE |
| 125 | +- [x] Add function to set DVDCSS_METHOD |
| 126 | +- [ ] Implement dvdcss_readv, not sure how this would be used or implemented |
| 127 | +- [ ] Handle errors for failed cdll calls if any? |
128 | 128 |
|
129 | 129 | <p> </p><p> </p>
|
130 | 130 |
|
@@ -161,10 +161,10 @@ happened.
|
161 | 161 | Tips:
|
162 | 162 |
|
163 | 163 | > Use SEEK_MPEG flag when seeking throughout VOB data sectors. It isn't needed
|
164 |
| - on the first sector. |
| 164 | +> on the first sector. |
165 | 165 |
|
166 |
| -> Use SEEK_KEY flag the first time you enter a TITLE. You *can* always call it |
167 |
| - in VOB data sectors, however it will be unnecessary and cause slowdowns. |
| 166 | +> Use SEEK_KEY flag the first time you enter a TITLE. You _can_ always call it |
| 167 | +> in VOB data sectors, however it will be unnecessary and cause slowdowns. |
168 | 168 |
|
169 | 169 | - **i_blocks**: absolute block offset to seek to.
|
170 | 170 | - **i_flags**: NOFLAGS by default, or you can specify SEEK_KEY or SEEK_MPEG flags.
|
@@ -214,4 +214,4 @@ Returns True if it's scrambled.
|
214 | 214 |
|
215 | 215 | ## [CONTRIBUTORS](https://github.com/rlaPHOENiX/pydvdcss/graphs/contributors)
|
216 | 216 |
|
217 |
| -</span> |
| 217 | +</span> |
0 commit comments