mirror of
				https://github.com/devine-dl/pywidevine.git
				synced 2025-11-04 03:44:50 +00:00 
			
		
		
		
	PSSH: Rework from_playready_pssh as a class method
This commit is contained in:
		
							parent
							
								
									0537c9666c
								
							
						
					
					
						commit
						9d7eaf4949
					
				@ -179,14 +179,14 @@ class PSSH:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return cls(box)
 | 
					        return cls(box)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @staticmethod
 | 
					    @classmethod
 | 
				
			||||||
    def from_playready_pssh(box: Container) -> Container:
 | 
					    def from_playready_pssh(cls, box: Container) -> PSSH:
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        Convert a PlayReady PSSH to a Widevine PSSH.
 | 
					        Convert a PlayReady PSSH Box to a Widevine PSSH Box.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Note: The resulting Widevine PSSH will likely not be usable for Licensing. This
 | 
					        Note: The resulting Widevine PSSH will likely not be usable for Licensing. This
 | 
				
			||||||
        is because there is some data for a Widevine CENC Header that is not going to be
 | 
					        is because there is some data for a Widevine Cenc Header that is missing from a
 | 
				
			||||||
        listed in a PlayReady PSSH.
 | 
					        PlayReady PSSH Box.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        This converted PSSH will only be useful for it's Key IDs, so realistically only
 | 
					        This converted PSSH will only be useful for it's Key IDs, so realistically only
 | 
				
			||||||
        for matching Key IDs with a Track. As a fallback.
 | 
					        for matching Key IDs with a Track. As a fallback.
 | 
				
			||||||
@ -211,7 +211,7 @@ class PSSH:
 | 
				
			|||||||
        box.init_data = cenc_header.SerializeToString()
 | 
					        box.init_data = cenc_header.SerializeToString()
 | 
				
			||||||
        box.system_ID = PSSH.SystemId.Widevine
 | 
					        box.system_ID = PSSH.SystemId.Widevine
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return box
 | 
					        return cls(box)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @staticmethod
 | 
					    @staticmethod
 | 
				
			||||||
    def from_key_ids(key_ids: list[UUID]) -> Container:
 | 
					    def from_key_ids(key_ids: list[UUID]) -> Container:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user