Skip to content

Instantly share code, notes, and snippets.

SgDylan Sg4Dylan

Block or report user

Report or block Sg4Dylan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Sg4Dylan
Sg4Dylan / postLiveDanmaku.py
Created Sep 5, 2017
简单的Bilibili直播弹幕发送实现
View postLiveDanmaku.py
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Update: 9/5/2017
import requests
import ast
def sessionPool(pool_connections=2, pool_maxsize=5, max_retries=5):
session = requests.Session()
View convert_m3u_encode.py
import os
from_e = 'utf-8'
to_e = 'gbk'
command = "iconv -f %s -t %s " % (from_e, to_e)
for i in os.listdir():
if i.endswith('.m3u'):
file_s = "\"%s\" > \"%s\"" % (i,to_e+i)
os.system(command+file_s)
os.remove(i)
View keybase.md

Keybase proof

I hereby claim:

  • I am Sg4Dylan on github.
  • I am sg4dylan (https://keybase.io/sg4dylan) on keybase.
  • I have a public key whose fingerprint is D83C 52B6 F7F5 CFBE 44C9 8D89 B588 E63E 0BE1 1E57

To claim this, I am signing this object:

@Sg4Dylan
Sg4Dylan / nox_time_calibrator.py
Created Dec 4, 2017
Nox Android 模拟器校时脚本,放置在安装目录下的 bin 目录双击使用,每分钟同步一次模拟器与主机的时间
View nox_time_calibrator.py
import subprocess
import time
from datetime import datetime as dt
import logging
logging.basicConfig(level=logging.DEBUG,
format='[%(asctime)s][%(levelname)s][%(funcName)-2s]-> %(message)s',
datefmt='%m-%d %H:%M:%S')
subprocess.call("nox_adb connect 127.0.0.1:52001",shell=False)
@Sg4Dylan
Sg4Dylan / biliplus_exporter.js
Last active Dec 4, 2017
导出 biliplus 下载链接,并简单合并下载的视频分片
View biliplus_exporter.js
// 显示下载链接的侧边栏加载完成后,在 Console 复制这段 JS 并执行
// 执行完成后,鼠标选中一组链接,ctrl+c 复制到 aria2 即可批量下载视频
// 格式化版
var total_area = document.getElementById('geturl_content');
var split_area = total_area.getElementsByTagName('div');
var itemDocs = [];
for (let i=0;i<split_area.length;i++) {
if(split_area[i].style[0]=="width") {
itemDocs.push(split_area[i]);
@Sg4Dylan
Sg4Dylan / bbc_broadcast.sh
Last active Dec 4, 2017
树莓派 FM 转播 BBC / Broadcast BBC radio via RaspberryPi / 树莓派转播网络直播音频(以 Bilibili 直播为例)
View bbc_broadcast.sh
#!/bin/bash
# Raspberry broadcast fm shell
# - A believing heart is your magic -
# Dependency:
# FFmpeg: pacman -S ffmpeg
# PiFmRds: https://github.com/ChristopheJacquet/PiFmRds
# BBC Radio
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p"
@Sg4Dylan
Sg4Dylan / auto_poster.py
Last active Dec 4, 2017
自动糊海报工具及配置文件
View auto_poster.py
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Created: 7/14/2017
from PIL import Image,ImageFont,ImageDraw
import render_config as config
def auto_poster(text: dict, param: dict):
@Sg4Dylan
Sg4Dylan / AutoSrunWebAuth.py
Last active Dec 4, 2017
模拟深澜Srun系统认证(Python/Shell)
View AutoSrunWebAuth.py
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Purpose: A simple script to complete srun's webauth
# Created: 03/01/2017
# 配合 crontab 使用
# */5 6-22 * * * /usr/bin/python3 /pathtoyourscript/LoginSrunWebAuth.py
import requests
View get_play_status_from_netease_music.py
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan -- <sg4dylan#gmail.com>
# Update: 10/13/2017
'''
透过 Chrome Debug Protocol 读取网易云音乐当前播放状态
启动播放器时附带启动参数
--remote-debugging-port=8080
@Sg4Dylan
Sg4Dylan / getLiveComment.py
Last active Feb 14, 2018
简单的Bilibili直播弹幕抓取实现
View getLiveComment.py
#!/usr/bin/env python
import socket
import binascii
import threading
import time
import json
reconnect_flag = 0
You can’t perform that action at this time.