mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 03:44:49 +00:00 
			
		
		
		
	Store DRM in the track.drm property in HLS and DASH
This commit is contained in:
		
							parent
							
								
									f8166f098c
								
							
						
					
					
						commit
						318832e6b2
					
				@ -302,6 +302,7 @@ class DASH:
 | 
			
		||||
            adaptation_set.findall("ContentProtection")
 | 
			
		||||
        )
 | 
			
		||||
        if drm:
 | 
			
		||||
            track.drm = drm
 | 
			
		||||
            drm = drm[0]  # just use the first supported DRM system for now
 | 
			
		||||
            if isinstance(drm, Widevine):
 | 
			
		||||
                # license and grab content keys
 | 
			
		||||
@ -336,7 +337,6 @@ class DASH:
 | 
			
		||||
            # Players would normally calculate segments via Byte-Ranges, but we don't care
 | 
			
		||||
            track.url = urljoin(period_base_url, base_url)
 | 
			
		||||
            track.descriptor = track.Descriptor.URL
 | 
			
		||||
            track.drm = [drm] if drm else []
 | 
			
		||||
        else:
 | 
			
		||||
            segments: list[tuple[str, Optional[str]]] = []
 | 
			
		||||
 | 
			
		||||
@ -442,6 +442,7 @@ class DASH:
 | 
			
		||||
                    # it might not have Widevine DRM, or might not have found the PSSH
 | 
			
		||||
                    log.warning("No Widevine PSSH was found for this track, is it DRM free?")
 | 
			
		||||
                else:
 | 
			
		||||
                    track.drm = [drm]
 | 
			
		||||
                    # license and grab content keys
 | 
			
		||||
                    if not license_widevine:
 | 
			
		||||
                        raise ValueError("license_widevine func must be supplied to use Widevine DRM")
 | 
			
		||||
 | 
			
		||||
@ -242,6 +242,7 @@ class HLS:
 | 
			
		||||
                            sys.exit(1)
 | 
			
		||||
                        else:
 | 
			
		||||
                            if drm:
 | 
			
		||||
                                track.drm = drm
 | 
			
		||||
                                drm = drm[0]  # just use the first supported DRM system for now
 | 
			
		||||
                                log.debug("Got segment key, %s", drm)
 | 
			
		||||
                                if isinstance(drm, Widevine):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user