This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# VKontakte *m3u8 downloader | |
# Worked at the time of writing | |
mkdir /tmp/m3u8 | |
set -e -x | |
cd /tmp/m3u8 | |
rm * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ip2hex(cidr, router): | |
addr, mask = cidr.split("/") | |
mask = int(mask) | |
addr = [("%2s" % hex(int(i))[2:]).replace(" ", "0") for i in addr.split(".") if i != "0"] | |
parts = mask/8 - len(addr) | |
if mask%8 > 0: | |
parts += 1 | |
if parts > 0: | |
for i in range(int(parts)): | |
addr.append("00") |