Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

xjohjrdy xjohjrdy

🎯
Focusing
View GitHub Profile
@xjohjrdy
xjohjrdy / ipdb2txt.py
Created Mar 12, 2020
ipip新版本IP库格式转换
View ipdb2txt.py
# -*- coding: utf-8 -*-
import ipaddress
import json
import sys
import struct
def bytes2long(a, b, c, d):
return convert(a) << 24 | convert(b) << 16 | convert(c) << 8 | convert(d)
@xjohjrdy
xjohjrdy / xiaoxiao_tts.py
Last active May 15, 2021
返回的音频没有文件头,所以我随便加的一个文件头,但显示的音频时长有问题。如果播放器不能正常播放,可以使用Chrome播放。
View xiaoxiao_tts.py
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from ws4py.client.threadedclient import WebSocketClient
import binascii
class WSClient(WebSocketClient):
def __init__(self, url, text, filename):