<commit_before>﻿using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace MediaBrowser.Plugins.RottenTomatoes.Providers
{
    public class RottenTomatoesProvider : ICustomMetadataProvider<Movie>, ICustomMetadataProvider<Trailer>, IHasChangeMonitor
    {
        // http://developer.rottentomatoes.com/iodocs
        private const int DailyRefreshLimit = 1000;
        private const string MoviesReviews = @"movies/{1}/reviews.json?review_type=top_critic&page_limit=12&page=1&country=us&apikey={0}";

        private readonly string[] _apiKeys =
            {
                // MB Server key (listed 3x because we have a 30k limit)
                "<KEY>",

                // MB Server key (listed 3x because we have a 30k limit)
                "<KEY>",

                // MB Server key (listed 3x because we have a 30k limit)
                "<KEY>",

                // Donated by Redshirt
                "gecbjvjka5may65qmqrczk97"
            };

        private const string BasicUrl = @"http://api.rottentomatoes.com/api/public/v1.0/";
        private const string MovieImdb = @"movie_alias.json?id={1}&type=imdb&apikey={0}";
        private readonly SemaphoreSlim _rottenTomatoesResourcePool = new SemaphoreSlim(1, 1);<commit_msg>reduce request limit<commit_after>﻿using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace MediaBrowser.Plugins.RottenTomatoes.Providers
{
    public class RottenTomatoesProvider : ICustomMetadataProvider<Movie>, ICustomMetadataProvider<Trailer>, IHasChangeMonitor
    {
        // http://developer.rottentomatoes.com/iodocs
        private const int DailyRefreshLimit = 250;
        private const string MoviesReviews = @"movies/{1}/reviews.json?review_type=top_critic&page_limit=12&page=1&country=us&apikey={0}";

        private readonly string[] _apiKeys =
            {
                // MB Server key (listed 3x because we have a 30k limit)
                "<KEY>",

                // MB Server key (listed 3x because we have a 30k limit)
                "<KEY>",

                // MB Server key (listed 3x because we have a 30k limit)
                "<KEY>",

                // Donated by Redshirt
                "gecbjvjka5may65qmqrczk97"
            };

        private const string BasicUrl = @"http://api.rottentomatoes.com/api/public/v1.0/";
        private const string MovieImdb = @"movie_alias.json?id={1}&type=imdb&apikey={0}";
        private readonly SemaphoreSlim _rottenTomatoesResourcePool = new SemaphoreSlim(1, 1);
{'fraction_non_alphanumeric': 0.09526525955504848, 'fraction_numerical': 0.016257843696520252, 'mean_word_length': 3.250909090909091, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7151982', 'n_tokens_mistral': 1030, 'n_tokens_neox': 978, 'n_words': 229}