mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 11:54:50 +00:00 
			
		
		
		
	Set stop event & mark track failed if DASH DRM fails to license
This commit is contained in:
		
							parent
							
								
									6e844409ae
								
							
						
					
					
						commit
						8ada6165e3
					
				@ -391,13 +391,18 @@ class DASH:
 | 
				
			|||||||
            if track.drm:
 | 
					            if track.drm:
 | 
				
			||||||
                # last chance to find the KID, assumes first segment will hold the init data
 | 
					                # last chance to find the KID, assumes first segment will hold the init data
 | 
				
			||||||
                track_kid = track_kid or track.get_key_id(url=segments[0][0], session=session)
 | 
					                track_kid = track_kid or track.get_key_id(url=segments[0][0], session=session)
 | 
				
			||||||
                # license and grab content keys
 | 
					 | 
				
			||||||
                # TODO: What if we don't want to use the first DRM system?
 | 
					                # TODO: What if we don't want to use the first DRM system?
 | 
				
			||||||
                drm = track.drm[0]
 | 
					                drm = track.drm[0]
 | 
				
			||||||
                if isinstance(drm, Widevine):
 | 
					                if isinstance(drm, Widevine):
 | 
				
			||||||
 | 
					                    # license and grab content keys
 | 
				
			||||||
 | 
					                    try:
 | 
				
			||||||
                        if not license_widevine:
 | 
					                        if not license_widevine:
 | 
				
			||||||
                            raise ValueError("license_widevine func must be supplied to use Widevine DRM")
 | 
					                            raise ValueError("license_widevine func must be supplied to use Widevine DRM")
 | 
				
			||||||
                        license_widevine(drm, track_kid=track_kid)
 | 
					                        license_widevine(drm, track_kid=track_kid)
 | 
				
			||||||
 | 
					                    except Exception:  # noqa
 | 
				
			||||||
 | 
					                        stop_event.set()  # skip pending track downloads
 | 
				
			||||||
 | 
					                        progress(downloaded="[red]FAILED")
 | 
				
			||||||
 | 
					                        raise
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                drm = None
 | 
					                drm = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user