|
|
@ -6,7 +6,7 @@ import threading
|
|
|
|
from .common import FileDownloader
|
|
|
|
from .common import FileDownloader
|
|
|
|
from ..downloader import get_suitable_downloader
|
|
|
|
from ..downloader import get_suitable_downloader
|
|
|
|
from ..extractor.niconico import NiconicoIE
|
|
|
|
from ..extractor.niconico import NiconicoIE
|
|
|
|
from ..compat import compat_urllib_request
|
|
|
|
from ..utils import sanitized_Request
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NiconicoDmcFD(FileDownloader):
|
|
|
|
class NiconicoDmcFD(FileDownloader):
|
|
|
@ -29,9 +29,11 @@ class NiconicoDmcFD(FileDownloader):
|
|
|
|
heartbeat_data = heartbeat_info_dict['data'].encode()
|
|
|
|
heartbeat_data = heartbeat_info_dict['data'].encode()
|
|
|
|
heartbeat_interval = heartbeat_info_dict.get('interval', 30)
|
|
|
|
heartbeat_interval = heartbeat_info_dict.get('interval', 30)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request = sanitized_Request(heartbeat_url, heartbeat_data)
|
|
|
|
|
|
|
|
|
|
|
|
def heartbeat():
|
|
|
|
def heartbeat():
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
compat_urllib_request.urlopen(url=heartbeat_url, data=heartbeat_data)
|
|
|
|
self.ydl.urlopen(request).read()
|
|
|
|
except Exception:
|
|
|
|
except Exception:
|
|
|
|
self.to_screen('[%s] Heartbeat failed' % self.FD_NAME)
|
|
|
|
self.to_screen('[%s] Heartbeat failed' % self.FD_NAME)
|
|
|
|
|
|
|
|
|
|
|
|