Skip to content

Instantly share code, notes, and snippets.

View RogerRordo's full-sized avatar
🧐
I may be slow to respond.

ROrdo RogerRordo

🧐
I may be slow to respond.
  • Pony.ai
  • Guangzhou, Guangdong, China
View GitHub Profile
@RogerRordo
RogerRordo / ssh-copy-id.bat
Created January 19, 2021 12:48
ssh-copy-id for Windows
@echo off
set /p SERVER=user@host:
type %SystemDrive%%HomePath%\.ssh\id_rsa.pub | ssh %SERVER% "mkdir .ssh ; cat >> .ssh/authorized_keys"
pause
@RogerRordo
RogerRordo / get_automatic_captions.py
Last active April 5, 2021 06:55
20201212-临时解决youtube_dl无法下载自动字幕的问题
#替换youtube-dl/extractor/youtube.py的_get_automatic_captions函数
def _get_automatic_captions(self, video_id, webpage):
"""We need the webpage for getting the captions url, pass it as an
argument to speed up the process."""
self.to_screen('%s: Looking for automatic captions' % video_id)
err_msg = 'Couldn\'t find automatic captions for %s' % video_id
pattern = r'var\s*ytInitialPlayerResponse\s*=\s*({.+?});'