Skip to content

Instantly share code, notes, and snippets.

View Sg4Dylan's full-sized avatar
🐱

SgDylan Sg4Dylan

🐱
View GitHub Profile
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)

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 / biliplus_exporter.js
Last active August 7, 2023 08:09
导出 biliplus 下载链接,并简单合并下载的视频分片
// 显示下载链接的侧边栏加载完成后,在 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 / nox_time_calibrator.py
Created December 4, 2017 10:55
Nox Android 模拟器校时脚本,放置在安装目录下的 bin 目录双击使用,每分钟同步一次模拟器与主机的时间
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 / batch_img_convert.py
Created September 28, 2018 06:43
图片原地批量转换
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Created: 9/28/2018
# ==========================================
# Any>WEBP Any>JPEG 图片原地批量转换
# ==========================================
# 使用方法: 把待转换的文件夹拖放到脚本上
import os
@Sg4Dylan
Sg4Dylan / pixiv-file-rename.py
Last active November 13, 2020 13:53
给 Pixiv 下载的图片重命名
#!/usr/bin/env python
#coding:utf-8
# Author: Sg4Dylan --<sg4dylan#gmail.com>
# Created: 12/31/2018
# ==========================================
# Pixiv 图片重命名
# ==========================================
# 使用方法: 把待处理的「文件夹」拖放到脚本上
@Sg4Dylan
Sg4Dylan / EhTagTranslatorWrapper.py
Created January 5, 2019 04:10
E绅士翻译注射器💉Wiki 解析实现
'''
E绅士翻译注射器💉Wiki 解析实现
直接用 EhTagBuilder 就能拿到 JSON 格式的数据库
本脚本是为方便集成做的简易版解析实现
参考了 EhTagTranslator 的实现过程
'''
import re
import json
import requests
@Sg4Dylan
Sg4Dylan / utorrent_autoban.py
Last active May 6, 2020 23:20
uTorrent 自动屏蔽迅雷
import re
import os
import json
import time
import base64
import requests
ipfilter_path = r'D:\Program Files (x86)\uTorrent\ipfilter.dat' # ipfilter.dat 路径
remote_url = 'http://127.0.0.1:23333/gui/' # uTorrent 使用的 WebUI 地址
username = b'admin' # WebUI 使用的用户名
@Sg4Dylan
Sg4Dylan / BH1750_CTL.ino
Created June 24, 2019 12:58
显示器亮度自动调节套装
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup(){
Serial.begin(9600);
// Initialize the I2C bus (BH1750 library doesn't do this automatically)
// On esp8266 devices you can select SCL and SDA pins using Wire.begin(D4, D3);
Wire.begin();
@Sg4Dylan
Sg4Dylan / regnet.ipynb
Created May 8, 2020 01:14
RegNet 模型使用/导出ONNX - Colab 版本
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.