<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using CSCore.Codecs.MP3;
using RequestifyTF2.API;

namespace TTSPlugin
{
    public class TTSPlugin : IRequestifyPlugin
    {
        public string Author => "Weespin";
        public string Name => "TTS";
        public string Desc => "tts \"text\"";
    }

    public class MttsPlugin : IRequestifyCommand
    {
        private const int engine = 4;
        private const int lang = 1;
        private const int level1 = 0;
        private const int level2 = 0;
        private const int voice = 5;
        private const int accid = 5883747;
        private const string secret = "<KEY>";
        public string Help => "Playing a David UK (MLG) voice";

        public string Name => "mtts";
        public bool OnlyAdmin => false;
        public List<string> Alias => new List<string>();

        public void Execute(User executor, List<string> arguments)
        {
            if (arguments.Count > 0)
            {
                var text = arguments.Aggregate(" ", (current, argument) => current + " " + argument);
                var magic = $"{engine}{lang}{voice}{text}1mp3{accid}{secret}";
                var checksum = MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(magic));
                var stringchecksum = string.Concat(Array.ConvertAll(checksum, x => x.ToString("X2")));
                var url =
                    $"http://cache-a.oddcast.com/tts/gen.php?EID={engine}&LID={lang}&VID={voice}&TXT={text}&IS_UTF8=1&EXT=mp3&FNAME=&ACC={accid}&API=&SESSION=&CS={checksum}&cache_flag=3";

                Instance.QueueForeGround.Enqueue(new Mp3MediafoundationDecoder(url));<commit_msg>Woops, im blind<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using CSCore.Codecs.MP3;
using RequestifyTF2.API;

namespace TTSPlugin
{
    public class TTSPlugin : IRequestifyPlugin
    {
        public string Author => "Weespin";
        public string Name => "TTS";
        public string Desc => "tts \"text\"";
    }

    public class MttsPlugin : IRequestifyCommand
    {
        private const int engine = 4;
        private const int lang = 1;
        private const int level1 = 0;
        private const int level2 = 0;
        private const int voice = 5;
        private const int accid = 5883747;
        private const string secret = "<KEY>";
        public string Help => "Playing a David UK (MLG) voice";

        public string Name => "mtts";
        public bool OnlyAdmin => false;
        public List<string> Alias => new List<string>();

        public void Execute(User executor, List<string> arguments)
        {
            if (arguments.Count > 0)
            {
                var text = arguments.Aggregate(" ", (current, argument) => current + " " + argument);
                var magic = $"{engine}{lang}{voice}{text}1mp3{accid}{secret}";
                var checksum = MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(magic));
                var stringchecksum = string.Concat(Array.ConvertAll(checksum, x => x.ToString("X2")));
                var url =
                    $"http://cache-a.oddcast.com/tts/gen.php?EID={engine}&LID={lang}&VID={voice}&TXT={text}&IS_UTF8=1&EXT=mp3&FNAME=&ACC={accid}&API=&SESSION=&CS={stringchecksum}&cache_flag=3";

                Instance.QueueForeGround.Enqueue(new Mp3MediafoundationDecoder(url));
{'fraction_non_alphanumeric': 0.12332079527135949, 'fraction_numerical': 0.013970983342289092, 'mean_word_length': 2.711864406779661, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1527147', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1090, 'n_words': 273}