1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-29 05:32:00 +00:00

Use IE._download_json()

This commit is contained in:
nomevi 2022-07-10 01:35:21 +02:00
parent c9e09d187f
commit 26dc85adb4

View file

@ -2,7 +2,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from .common import InfoExtractor from .common import InfoExtractor
import json
import time import time
import calendar import calendar
@ -29,7 +28,7 @@ class LivestreamfailsIE(InfoExtractor):
# https://livestreamfails.com/clip/id uses https://api.livestreamfails.com/clip/ to fetch the video metadata # https://livestreamfails.com/clip/id uses https://api.livestreamfails.com/clip/ to fetch the video metadata
# Use the same endpoint here to avoid loading and parsing the provided page (which requires JS) # Use the same endpoint here to avoid loading and parsing the provided page (which requires JS)
api_response = json.loads(self._download_webpage('https://api.livestreamfails.com/clip/' + id, id)) api_response = self._download_json('https://api.livestreamfails.com/clip/' + id, id)
# Get the input timestamp (test case gives 2022-06-26T19:29:45.515Z) # Get the input timestamp (test case gives 2022-06-26T19:29:45.515Z)
timestamp = api_response.get('createdAt') timestamp = api_response.get('createdAt')