zoukankan      html  css  js  c++  java
  • baidu mp3竟然还加密,太扯了

     public class BaiduHelper
        {

            static int F = 0;
            static string I = "", J = "";
            static string O = "";
            static string E = "";
            static int[] K = new int[1000];
            static int[] H = new int[1000];
            static int M = 0;

            /// <summary>
            /// GetBaiduMp3Url
            /// </summary>
            /// <param name="str"></param>
            /// <param name="key"></param>
            /// <returns></returns>
            public static string GetBaiduMp3Url(String str, int key)
            {
                F = key;
                I = str;
                J = str;
                N(0, 9, 48);
                N(10, 35, 55);
                N(36, 61, 61);

                M = F % 26;
                M = (M > -1) ? M : 1;

                O = A(I);
                E = (I == J) ? O : A(J);
                return E;
            }

            public static void N(int S, int P, int Q)
            {
                for (int R = S; R <= P; R++)
                {
                    K[R] = R + Q;
                    H[R + Q] = R;
                }
            }

            public static string A(string Q)
            {
                int P = Q.Length;
                string S = "";
                char[] chars = Q.ToCharArray();
                for (int R = 0; R < P; R++) {
                    char T = chars[R];
                    if (Regex.IsMatch(T.ToString(),"[a-zA-Z0-9]")) {
                        int U = H[chars[R]] - M;
                        if (U < 0) {
                         U += 62 ;
                         }
                        T = (char)(K[U]);//String.fromCharCode
                    }
                    S += T;
                }
                return S;
            }
        }

  • 相关阅读:
    js触摸屏案例
    Docker
    Docker 镜像加速
    Docker 命令大全
    linux gpasswd
    Docker基础教程
    PHP输出毫秒时间戳
    PHP Variable handling 函数
    Partition Array by Odd and Even
    Median
  • 原文地址:https://www.cnblogs.com/yesun/p/1375995.html
Copyright © 2011-2022 走看看