mirror of
https://github.com/MetaCubeX/subconverter.git
synced 2025-11-04 18:19:42 +08:00
Fix support for some non-standard subscription
Add Dockerfile for image auto update.
This commit is contained in:
parent
3a39977253
commit
4374a3e8bd
16
scripts/Dockerfile
Normal file
16
scripts/Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
FROM alpine:latest
|
||||
MAINTAINER Tindy X <tindy.it@gmail.com>
|
||||
|
||||
# build minimized
|
||||
RUN apk add git g++ build-base linux-headers cmake && \
|
||||
apk add libressl-dev curl-dev rapidjson-dev libevent-dev pcre-dev yaml-cpp-dev && \
|
||||
git clone https://github.com/tindy2013/subconverter && \
|
||||
cd subconverter && \
|
||||
cmake . && \
|
||||
make -j4 && \
|
||||
mv subconverter base/ && \
|
||||
apk add curl yaml-cpp libevent && \
|
||||
apk del git gcc g++ build-base linux-headers cmake libressl-dev curl-dev rapidjson-dev libevent-dev yaml-cpp-dev
|
||||
|
||||
# set entry
|
||||
CMD /subconverter/base/subconverter
|
||||
15
src/misc.cpp
15
src/misc.cpp
@ -124,7 +124,7 @@ unsigned char FromHex(unsigned char x)
|
||||
else if (x >= '0' && x <= '9')
|
||||
y = x - '0';
|
||||
else
|
||||
assert(0);
|
||||
y = x;
|
||||
return y;
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ std::string UrlEncode(const std::string& str)
|
||||
|
||||
std::string UrlDecode(const std::string& str)
|
||||
{
|
||||
std::string strTemp = "";
|
||||
std::string strTemp;
|
||||
size_t length = str.length();
|
||||
for (size_t i = 0; i < length; i++)
|
||||
{
|
||||
@ -164,9 +164,14 @@ std::string UrlDecode(const std::string& str)
|
||||
{
|
||||
if(i + 2 >= length)
|
||||
return strTemp;
|
||||
unsigned char high = FromHex((unsigned char)str[++i]);
|
||||
unsigned char low = FromHex((unsigned char)str[++i]);
|
||||
strTemp += high * 16 + low;
|
||||
if(isalnum(str[i + 1]) && isalnum(str[i + 2]))
|
||||
{
|
||||
unsigned char high = FromHex((unsigned char)str[++i]);
|
||||
unsigned char low = FromHex((unsigned char)str[++i]);
|
||||
strTemp += high * 16 + low;
|
||||
}
|
||||
else
|
||||
strTemp += str[i];
|
||||
}
|
||||
else
|
||||
strTemp += str[i];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user