1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-04 12:34:53 -04:00

[cleanup] Misc cleanup (#2173)

Authored by: fstirlitz, pukkandan
This commit is contained in:
pukkandan
2022-04-12 05:31:54 +05:30
parent f82711587c
commit e5a998f368
13 changed files with 46 additions and 33 deletions

View File

@@ -1,6 +1,6 @@
import hashlib
import json
import re
from hashlib import sha256
from .ffmpeg import FFmpegPostProcessor
from ..compat import compat_urllib_parse_urlencode
@@ -84,7 +84,7 @@ class SponsorBlockPP(FFmpegPostProcessor):
return sponsor_chapters
def _get_sponsor_segments(self, video_id, service):
hash = sha256(video_id.encode('ascii')).hexdigest()
hash = hashlib.sha256(video_id.encode('ascii')).hexdigest()
# SponsorBlock API recommends using first 4 hash characters.
url = f'{self._API_URL}/api/skipSegments/{hash[:4]}?' + compat_urllib_parse_urlencode({
'service': service,