The branch, gotham has been updated
       via  b9088fe5864faa2668319e85e7dfedc74683dcc9 (commit)
      from  3375611fcc25eaa3a5574381d7da01f0dacaa9c1 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=b9088fe5864faa2668319e85e7dfedc74683dcc9

commit b9088fe5864faa2668319e85e7dfedc74683dcc9
Author: Martijn Kaijser <[email protected]>
Date:   Wed Apr 16 14:25:51 2014 +0200

    [service.subtitles.itasa] 1.0.0

diff --git a/service.subtitles.itasa/addon.xml 
b/service.subtitles.itasa/addon.xml
index 3187a33..887d86a 100644
--- a/service.subtitles.itasa/addon.xml
+++ b/service.subtitles.itasa/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="service.subtitles.itasa"
        name="italiansubs.net"
-       version="0.0.5"
+       version="1.0.0"
        provider-name="phate89">
   <requires>
     <import addon="xbmc.python" version="2.14.0"/>
diff --git a/service.subtitles.itasa/changelog.txt 
b/service.subtitles.itasa/changelog.txt
index b78e010..c539757 100644
--- a/service.subtitles.itasa/changelog.txt
+++ b/service.subtitles.itasa/changelog.txt
@@ -1,3 +1,9 @@
+1.0.0
+- replaced website download with api download and improved "download too many 
times" check
+- updated thetvdb ids
+- added trick to force sync versions on top of the list
+- bumped to first "official" version
+
 0.0.5
 - fixed bug with the retrieve tv show list function
 - added fallback to filename search in case search by tv show name fails
diff --git a/service.subtitles.itasa/resources/Serie.json 
b/service.subtitles.itasa/resources/Serie.json
index 1d67eee..2311b6e 100644
--- a/service.subtitles.itasa/resources/Serie.json
+++ b/service.subtitles.itasa/resources/Serie.json
@@ -1,722 +1 @@
-{
-  "100002": "1324",
-  "100831": "1316",
-  "101271": "1353",
-  "101341": "1311",
-  "102441": "1781",
-  "102491": "1402",
-  "103321": "1384",
-  "104281": "1928",
-  "104641": "1413",
-  "106491": "1375",
-  "107631": "1983",
-  "108611": "1513",
-  "110381": "1687",
-  "111381": "1864",
-  "114461": "2703",
-  "114701": "2547",
-  "114711": "1533",
-  "117411": "1588",
-  "117731": "1595",
-  "119761": "1608",
-  "121361": "2291",
-  "121391": "1756",
-  "121431": "1679",
-  "123411": "1660",
-  "123581": "2300",
-  "124051": "1669",
-  "125621": "1636",
-  "129261": "3228",
-  "130111": "1682",
-  "134231": "1759",
-  "134241": "1791",
-  "134511": "1729",
-  "139941": "1948",
-  "140681": "2673",
-  "142561": "1784",
-  "142861": "1813",
-  "146711": "1840",
-  "148821": "1787",
-  "152651": "1798",
-  "153021": "2194",
-  "155201": "2734",
-  "158411": "1869",
-  "158661": "1875",
-  "158671": "1837",
-  "159431": "1937",
-  "159591": "1823",
-  "160671": "2295",
-  "160851": "2143",
-  "161461": "2499",
-  "161501": "1973",
-  "161511": "2347",
-  "162071": "1898",
-  "163531": "2068",
-  "163551": "2589",
-  "163561": "2138",
-  "163571": "2801",
-  "163851": "1996",
-  "163991": "2124",
-  "164011": "2404",
-  "164021": "2040",
-  "164031": "2053",
-  "164041": "2604",
-  "164091": "2967",
-  "164221": "2007",
-  "164301": "2029",
-  "164371": "2526",
-  "164401": "1999",
-  "164481": "2441",
-  "164501": "2153",
-  "164521": "2046",
-  "164541": "2065",
-  "164951": "2132",
-  "165381": "2004",
-  "165851": "1902",
-  "166091": "1852",
-  "166361": "2135",
-  "167421": "1861",
-  "167571": "2540",
-  "167581": "2090",
-  "168151": "2426",
-  "168161": "2337",
-  "168591": "1909",
-  "170551": "1888",
-  "171591": "1978",
-  "173441": "1920",
-  "174991": "2363",
-  "175001": "2666",
-  "175011": "2676",
-  "176941": "1961",
-  "180461": "3354",
-  "180791": "2312",
-  "182601": "2176",
-  "183331": "2197",
-  "185251": "2435",
-  "186551": "2459",
-  "187351": "3145",
-  "187881": "2506",
-  "187991": "2570",
-  "188011": "2454",
-  "192061": "2281",
-  "192171": "2240",
-  "193131": "2179",
-  "193571": "2237",
-  "194031": "2356",
-  "194041": "3186",
-  "194051": "2334",
-  "196841": "2209",
-  "196921": "2350",
-  "197101": "2886",
-  "197231": "2212",
-  "204781": "3832",
-  "205281": "2646",
-  "206751": "2509",
-  "207341": "2374",
-  "208791": "2487",
-  "210171": "2494",
-  "210841": "2680",
-  "211681": "2512",
-  "212571": "2367",
-  "212961": "3068",
-  "213081": "2298",
-  "213221": "2423",
-  "216181": "3306",
-  "217961": "3225",
-  "219341": "2484",
-  "219381": "3120",
-  "219701": "2456",
-  "220411": "3330",
-  "221381": "3281",
-  "221391": "2661",
-  "226881": "2683",
-  "230531": "2586",
-  "234461": "2779",
-  "237831": "3355",
-  "237951": "2551",
-  "239761": "2644",
-  "241531": "3009",
-  "242521": "3420",
-  "246771": "2532",
-  "247101": "3842",
-  "247361": "2872",
-  "247773": "2601",
-  "247774": "2631",
-  "247808": "2746",
-  "247897": "2946",
-  "248261": "2768",
-  "248393": "2592",
-  "248394": "2576",
-  "248503": "3078",
-  "248596": "4588",
-  "248646": "3126",
-  "248651": "3139",
-  "248682": "2876",
-  "248735": "3268",
-  "248736": "3071",
-  "248741": "2897",
-  "248742": "2856",
-  "248789": "3252",
-  "248793": "2882",
-  "248812": "3345",
-  "248830": "2819",
-  "248834": "2879",
-  "248835": "3042",
-  "248836": "3203",
-  "248837": "2869",
-  "248839": "3265",
-  "248841": "3756",
-  "248842": "2980",
-  "248861": "2905",
-  "248868": "2795",
-  "248880": "2941",
-  "248884": "2807",
-  "248930": "2900",
-  "248935": "3180",
-  "248936": "3163",
-  "248943": "2859",
-  "248950": "3318",
-  "249004": "3133",
-  "249081": "3083",
-  "249164": "2657",
-  "249361": "2964",
-  "249478": "2776",
-  "249698": "3103",
-  "249905": "2792",
-  "250078": "2738",
-  "250203": "2772",
-  "250423": "3024",
-  "250487": "2804",
-  "251539": "3003",
-  "251889": "3035",
-  "252322": "3030",
-  "252325": "3800",
-  "252870": "3123",
-  "253042": "3826",
-  "253073": "3213",
-  "253463": "3149",
-  "253556": "3168",
-  "254143": "3183",
-  "254378": "4319",
-  "255250": "3249",
-  "255316": "4099",
-  "255326": "4132",
-  "255413": "3576",
-  "255650": "4209",
-  "255677": "3272",
-  "255888": "4180",
-  "256204": "3652",
-  "256227": "3418",
-  "256352": "3308",
-  "257248": "3534",
-  "257377": "3412",
-  "257454": "3981",
-  "257630": "4001",
-  "257655": "3752",
-  "257939": "3538",
-  "258107": "4167",
-  "258171": "3395",
-  "258464": "4521",
-  "258540": "4038",
-  "258541": "3903",
-  "258602": "3419",
-  "258604": "3509",
-  "258616": "3588",
-  "258744": "3930",
-  "258773": "3987",
-  "258823": "3566",
-  "258959": "3757",
-  "258979": "3569",
-  "259007": "3852",
-  "259009": "3613",
-  "259012": "4170",
-  "259054": "4194",
-  "259055": "3882",
-  "259063": "4049",
-  "259071": "3971",
-  "259280": "3454",
-  "259529": "4129",
-  "259669": "4093",
-  "259702": "3714",
-  "259765": "3962",
-  "259860": "3814",
-  "259866": "4323",
-  "259948": "4079",
-  "260071": "3477",
-  "260313": "3990",
-  "260315": "4088",
-  "260320": "4066",
-  "260338": "4249",
-  "260355": "3476",
-  "260449": "4017",
-  "260485": "3892",
-  "261111": "3873",
-  "261272": "3563",
-  "261284": "3541",
-  "261451": "3797",
-  "261557": "4391",
-  "261656": "3559",
-  "261690": "3984",
-  "261742": "4073",
-  "261745": "3758",
-  "261802": "4226",
-  "262037": "4177",
-  "262407": "4799",
-  "262414": "4085",
-  "262585": "3790",
-  "262980": "3946",
-  "263365": "4430",
-  "263672": "3853",
-  "263677": "3942",
-  "263711": "4256",
-  "263724": "4587",
-  "263828": "3876",
-  "263921": "3864",
-  "264030": "4184",
-  "264085": "4310",
-  "264450": "4125",
-  "264492": "4269",
-  "264586": "4331",
-  "264605": "3907",
-  "264656": "3874",
-  "264991": "3949",
-  "265609": "4590",
-  "265912": "4745",
-  "266092": "4268",
-  "266189": "4383",
-  "266398": "4198",
-  "266609": "4161",
-  "266883": "4428",
-  "267014": "4260",
-  "267206": "4369",
-  "267258": "4876",
-  "267259": "4442",
-  "267260": "4741",
-  "267261": "4429",
-  "267702": "4638",
-  "267951": "4174",
-  "267971": "4158",
-  "268126": "4589",
-  "268591": "4591",
-  "268943": "4633",
-  "269159": "4796",
-  "269578": "4387",
-  "269586": "4405",
-  "269593": "4856",
-  "269594": "4509",
-  "269604": "4788",
-  "269637": "4394",
-  "269642": "4522",
-  "269643": "4446",
-  "269644": "4793",
-  "269646": "4476",
-  "269651": "4852",
-  "269653": "4420",
-  "269654": "4513",
-  "269895": "4689",
-  "270481": "4227",
-  "270633": "4756",
-  "270814": "4758",
-  "274337": "4759",
-  "274527": "4662",
-  "275663": "4757",
-  "70327": "3256",
-  "70490": "1745",
-  "70598": "353",
-  "70682": "169",
-  "70761": "57",
-  "70851": "217",
-  "70860": "4838",
-  "70900": "605",
-  "71606": "388",
-  "71663": "254",
-  "71691": "1330",
-  "71969": "1821",
-  "72108": "157",
-  "72129": "679",
-  "72135": "128",
-  "72158": "167",
-  "72164": "246",
-  "72167": "37",
-  "72173": "3051",
-  "72201": "162",
-  "72218": "202",
-  "72227": "280",
-  "72229": "124",
-  "72241": "457",
-  "72449": "220",
-  "72477": "241",
-  "72492": "1424",
-  "72546": "27",
-  "72663": "2275",
-  "72920": "110",
-  "73028": "1105",
-  "73029": "1931",
-  "73107": "267",
-  "73141": "13",
-  "73244": "458",
-  "73255": "52",
-  "73265": "145",
-  "73507": "225",
-  "73508": "186",
-  "73545": "84",
-  "73696": "28",
-  "73730": "287",
-  "73739": "134",
-  "73762": "79",
-  "73800": "46",
-  "73871": "621",
-  "73918": "336",
-  "74058": "797",
-  "74156": "363",
-  "74345": "2597",
-  "74379": "1671",
-  "74543": "839",
-  "74608": "744",
-  "74796": "306",
-  "74843": "200",
-  "74845": "386",
-  "74875": "339",
-  "74922": "41",
-  "75125": "611",
-  "75128": "35",
-  "75275": "366",
-  "75340": "176",
-  "75350": "3289",
-  "75367": "2568",
-  "75397": "147",
-  "75450": "198",
-  "75546": "172",
-  "75599": "259",
-  "75682": "22",
-  "75692": "609",
-  "75707": "262",
-  "75710": "39",
-  "75734": "183",
-  "75756": "379",
-  "75760": "100",
-  "75805": "555",
-  "75842": "421",
-  "75863": "3076",
-  "75897": "214",
-  "75914": "65",
-  "75930": "11",
-  "75978": "67",
-  "76143": "117",
-  "76156": "192",
-  "76177": "2453",
-  "76203": "1650",
-  "76245": "637",
-  "76290": "5",
-  "76321": "632",
-  "76467": "298",
-  "76509": "638",
-  "76568": "77",
-  "76738": "615",
-  "76924": "517",
-  "77666": "643",
-  "77955": "234",
-  "77963": "296",
-  "77996": "580",
-  "78142": "1274",
-  "78261": "251",
-  "78310": "29",
-  "78465": "63",
-  "78490": "858",
-  "78581": "329",
-  "78804": "748",
-  "78817": "74",
-  "78857": "760",
-  "78874": "3899",
-  "78889": "479",
-  "78901": "224",
-  "78902": "265",
-  "79066": "143",
-  "79106": "109",
-  "79126": "4361",
-  "79168": "617",
-  "79177": "126",
-  "79183": "463",
-  "79216": "239",
-  "79255": "90",
-  "79290": "291",
-  "79324": "294",
-  "79326": "141",
-  "79330": "105",
-  "79331": "113",
-  "79332": "285",
-  "79334": "61",
-  "79335": "179",
-  "79337": "72",
-  "79339": "115",
-  "79343": "223",
-  "79345": "112",
-  "79346": "209",
-  "79349": "48",
-  "79352": "282",
-  "79356": "1118",
-  "79372": "232",
-  "79380": "244",
-  "79381": "88",
-  "79384": "269",
-  "79388": "196",
-  "79389": "159",
-  "79481": "310",
-  "79488": "9",
-  "79501": "94",
-  "79506": "24",
-  "79509": "44",
-  "79511": "1356",
-  "79529": "92",
-  "79548": "1511",
-  "79563": "756",
-  "79635": "308",
-  "79637": "243",
-  "79647": "229",
-  "79679": "50",
-  "79686": "103",
-  "79701": "132",
-  "79755": "810",
-  "79759": "237",
-  "79773": "613",
-  "79789": "707",
-  "79809": "174",
-  "79824": "314",
-  "79842": "470",
-  "79846": "277",
-  "79868": "18",
-  "79869": "181",
-  "79871": "55",
-  "79875": "20",
-  "79876": "249",
-  "79925": "260",
-  "79934": "164",
-  "79988": "779",
-  "80000": "1574",
-  "80042": "309",
-  "80137": "642",
-  "80144": "369",
-  "80147": "307",
-  "80159": "190",
-  "80182": "98",
-  "80198": "440",
-  "80207": "257",
-  "80215": "351",
-  "80222": "349",
-  "80223": "347",
-  "80224": "311",
-  "80231": "82",
-  "80246": "375",
-  "80252": "453",
-  "80270": "360",
-  "80301": "382",
-  "80337": "442",
-  "80344": "390",
-  "80345": "401",
-  "80348": "408",
-  "80349": "384",
-  "80351": "395",
-  "80352": "543",
-  "80367": "448",
-  "80369": "416",
-  "80370": "406",
-  "80376": "403",
-  "80379": "399",
-  "80381": "455",
-  "80385": "519",
-  "80392": "423",
-  "80415": "414",
-  "80416": "436",
-  "80421": "562",
-  "80424": "473",
-  "80426": "482",
-  "80435": "1060",
-  "80441": "419",
-  "80446": "211",
-  "80461": "485",
-  "80462": "494",
-  "80463": "563",
-  "80481": "713",
-  "80494": "466",
-  "80505": "16",
-  "80512": "537",
-  "80542": "499",
-  "80547": "475",
-  "80570": "531",
-  "80593": "539",
-  "80621": "599",
-  "80644": "693",
-  "80649": "577",
-  "80671": "573",
-  "80680": "588",
-  "80736": "634",
-  "80913": "625",
-  "80965": "1120",
-  "81025": "653",
-  "81077": "646",
-  "81096": "312",
-  "81123": "664",
-  "81126": "710",
-  "81132": "661",
-  "81161": "1206",
-  "81165": "697",
-  "81189": "668",
-  "81248": "675",
-  "81253": "686",
-  "81289": "698",
-  "81318": "690",
-  "81346": "784",
-  "81365": "715",
-  "81386": "799",
-  "81452": "704",
-  "81487": "740",
-  "81502": "721",
-  "81517": "1644",
-  "81525": "725",
-  "81547": "738",
-  "81550": "729",
-  "81592": "754",
-  "81606": "1193",
-  "81634": "769",
-  "81797": "315",
-  "81816": "1010",
-  "81830": "776",
-  "81831": "752",
-  "81950": "765",
-  "81996": "770",
-  "82046": "1137",
-  "82066": "801",
-  "82091": "1265",
-  "82109": "836",
-  "82120": "786",
-  "82122": "1013",
-  "82155": "790",
-  "82201": "793",
-  "82230": "815",
-  "82283": "988",
-  "82289": "847",
-  "82304": "894",
-  "82339": "1063",
-  "82340": "845",
-  "82341": "359",
-  "82422": "818",
-  "82438": "825",
-  "82456": "822",
-  "82459": "843",
-  "82492": "829",
-  "82502": "861",
-  "82624": "854",
-  "82642": "1034",
-  "82670": "864",
-  "82672": "1041",
-  "82696": "891",
-  "82716": "875",
-  "82807": "1299",
-  "82825": "1023",
-  "82870": "1685",
-  "82895": "932",
-  "82902": "898",
-  "82916": "971",
-  "82925": "767",
-  "83025": "998",
-  "83028": "992",
-  "83066": "1001",
-  "83108": "925",
-  "83123": "927",
-  "83226": "1025",
-  "83232": "896",
-  "83237": "1426",
-  "83258": "1598",
-  "83266": "1017",
-  "83268": "960",
-  "83377": "1196",
-  "83427": "1027",
-  "83462": "1170",
-  "83463": "1101",
-  "83527": "900",
-  "83602": "1109",
-  "83610": "1255",
-  "83615": "1173",
-  "83616": "1189",
-  "83661": "1219",
-  "83662": "1036",
-  "83708": "1054",
-  "83734": "1057",
-  "83800": "1258",
-  "83805": "1107",
-  "83925": "1069",
-  "84021": "1200",
-  "84024": "1442",
-  "84067": "1141",
-  "84068": "1184",
-  "84084": "1209",
-  "84262": "1114",
-  "84347": "1088",
-  "84390": "1093",
-  "84414": "1155",
-  "84500": "1132",
-  "84644": "1332",
-  "84645": "1227",
-  "84676": "1359",
-  "84708": "1145",
-  "84912": "1212",
-  "84926": "1130",
-  "84946": "4713",
-  "84947": "1716",
-  "85040": "1230",
-  "85055": "1152",
-  "85075": "1159",
-  "85228": "1179",
-  "85242": "1439",
-  "85249": "1222",
-  "85330": "1186",
-  "85387": "1192",
-  "85427": "1407",
-  "85539": "1698",
-  "85559": "1260",
-  "86241": "1288",
-  "87231": "1252",
-  "87491": "1435",
-  "87621": "1240",
-  "87851": "1223",
-  "88031": "1208",
-  "88631": "1238",
-  "90571": "1242",
-  "92411": "1282",
-  "92521": "1250",
-  "93951": "1370",
-  "93991": "1354",
-  "94541": "1505",
-  "94551": "1710",
-  "94561": "1508",
-  "94571": "1429",
-  "94581": "1843",
-  "94801": "1701",
-  "94821": "1704",
-  "94971": "1610",
-  "94981": "1535",
-  "94991": "1410",
-  "95001": "1479",
-  "95011": "1432",
-  "95021": "1592",
-  "95031": "1738",
-  "95041": "1816",
-  "95291": "1495",
-  "95441": "1394",
-  "95451": "1397",
-  "95461": "1445",
-  "95471": "1436",
-  "95491": "1500",
-  "95501": "1518",
-  "95511": "1707",
-  "95681": "1279",
-  "95711": "1268",
-  "95731": "1271",
-  "95741": "1305",
-  "95751": "1335",
-  "95761": "1363",
-  "95781": "1371",
-  "98051": "1339",
-  "99101": "1328",
-  "99801": "1313"
-}
\ No newline at end of file
+{"161501": "1973", "73545": "84", "71663": "254", "84912": "1212", "250423": 
"3024", "78857": "760", "72546": "27", "78310": "29", "255326": "4132", 
"269613": "4931", "83527": "900", "95741": "1305", "81517": "1644", "80337": 
"442", "265766": "4935", "269594": "4509", "269593": "4856", "269592": "4924", 
"265609": "4590", "73265": "145", "82902": "898", "75930": "11", "79637": 
"243", "205281": "2646", "262037": "4177", "78889": "479", "94571": "1429", 
"117411": "1588", "262585": "3790", "92411": "1282", "81123": "664", "163851": 
"1996", "81126": "710", "94801": "1701", "248596": "4588", "192171": "2240", 
"104281": "1928", "163551": "2589", "80349": "384", "83232": "896", "82340": 
"845", "82341": "359", "277165": "4947", "164021": "2040", "260355": "3476", 
"94981": "1535", "75682": "22", "81831": "752", "81830": "776", "72167": "37", 
"72164": "246", "210171": "2494", "79290": "291", "261451": "3797", "82807": 
"1299", "260485": "3892", "80593": "539", "94971": "1610", "85242": "1439", 
 "80207": "257", "79686": "103", "248742": "2856", "248741": "2897", "257939": 
"3538", "165851": "1902", "249905": "2792", "193571": "2237", "234461": "2779", 
"79509": "44", "180791": "2312", "185251": "2435", "73762": "79", "79501": 
"94", "80182": "98", "267206": "4369", "75756": "379", "146711": "1840", 
"264605": "3907", "82120": "786", "249478": "2776", "194031": "2356", "80224": 
"311", "193131": "2179", "80505": "16", "102441": "1781", "255316": "4099", 
"79330": "105", "250078": "2738", "82716": "875", "79346": "209", "79345": 
"112", "79343": "223", "79349": "48", "95681": "1279", "73508": "186", "78817": 
"74", "168161": "2337", "117731": "1595", "73507": "225", "260071": "3477", 
"99101": "1328", "73696": "28", "256204": "3652", "80376": "403", "80370": 
"406", "82155": "790", "79488": "9", "80379": "399", "85055": "1152", "80570": 
"531", "207341": "2374", "160851": "2143", "259866": "4323", "259860": "3814", 
"84676": "1359", "100831": "1316", "255650": "4209", "73029": "1931", "7
 3028": "1105", "248837": "2869", "79755": "810", "259765": "3962", "255250": 
"3249", "82304": "894", "84946": "4713", "84947": "1716", "70327": "3256", 
"85330": "1186", "164481": "2441", "269646": "4476", "196841": "2209", 
"269644": "4793", "269643": "4446", "269642": "4522", "160671": "2295", 
"248839": "3265", "261557": "4391", "261802": "4226", "75805": "555", "248830": 
"2819", "82870": "1685", "248835": "3042", "248834": "2879", "140681": "2673", 
"248836": "3203", "94541": "1505", "264991": "3949", "95011": "1432", "264586": 
"4331", "265912": "4745", "78142": "1274", "216181": "3306", "219701": "2456", 
"166361": "2135", "264450": "4125", "74875": "339", "75842": "421", "79168": 
"617", "72492": "1424", "75978": "67", "263672": "3853", "83615": "1173", 
"250487": "2804", "263677": "3942", "83123": "927", "262980": "3946", "85387": 
"1192", "79789": "707", "75897": "214", "79846": "277", "87231": "1252", 
"74379": "1671", "187991": "2570", "121361": "2291", "130111": "1682", "88031": 
"
 1208", "80252": "453", "259012": "4170", "81096": "312", "80621": "599", 
"73800": "46", "208791": "2487", "76156": "192", "81592": "754", "153021": 
"2194", "85559": "1260", "70598": "353", "221381": "3281", "256227": "3418", 
"159431": "1937", "247101": "3842", "81950": "765", "257655": "3752", "75397": 
"147", "266092": "4268", "167421": "1861", "79869": "181", "79868": "18", 
"259948": "4079", "72227": "280", "79548": "1511", "72229": "124", "134231": 
"1759", "267971": "4158", "274123": "4944", "81248": "675", "210841": "2680", 
"255888": "4180", "248950": "3318", "246771": "2532", "83610": "1255", "74845": 
"386", "248261": "2768", "70682": "169", "82456": "822", "269604": "4788", 
"95731": "1271", "80416": "436", "164521": "2046", "80446": "211", "80441": 
"419", "84708": "1145", "83616": "1189", "95511": "1707", "84024": "1442", 
"163531": "2068", "74796": "306", "95471": "1436", "262414": "4085", "249698": 
"3103", "88631": "1238", "257248": "3534", "261745": "3758", "261742": "4073", 
 "81132": "661", "263921": "3864", "248943": "2859", "79126": "4361", "81502": 
"721", "82339": "1063", "264656": "3874", "95451": "1397", "82624": "854", 
"219381": "3120", "164011": "2404", "248842": "2980", "247774": "2631", 
"247773": "2601", "237951": "2551", "94991": "1410", "95021": "1592", "261111": 
"3873", "241531": "3009", "250203": "2772", "81346": "784", "79759": "237", 
"83237": "1426", "171591": "1978", "248736": "3071", "259054": "4194", 
"248735": "3268", "264030": "4184", "164301": "2029", "100002": "1324", 
"148821": "1787", "81189": "668", "95461": "1445", "72218": "202", "95781": 
"1371", "248861": "2905", "247808": "2746", "79679": "50", "82289": "847", 
"79824": "314", "121391": "1756", "75710": "39", "158411": "1869", "248646": 
"3126", "85427": "1407", "70490": "1745", "84347": "1088", "74345": "2597", 
"79372": "232", "268592": "4895", "75692": "609", "72173": "3051", "247897": 
"2946", "125621": "1636", "183331": "2197", "78804": "748", "242521": "3420", 
"82066": "801"
 , "158661": "1875", "253042": "3826", "212961": "3068", "84262": "1114", 
"187351": "3145", "80367": "448", "197101": "2886", "80369": "416", "164401": 
"1999", "269159": "4796", "197231": "2212", "84068": "1184", "85040": "1230", 
"266883": "4428", "84067": "1141", "266398": "4198", "248789": "3252", "84645": 
"1227", "84644": "1332", "163571": "2801", "83377": "1196", "83925": "1069", 
"81547": "738", "164371": "2526", "80965": "1120", "83268": "960", "258171": 
"3395", "95761": "1363", "83266": "1017", "87491": "1435", "170551": "1888", 
"256352": "3308", "155201": "2734", "83462": "1170", "269637": "4394", "79334": 
"61", "84414": "1155", "74543": "839", "78490": "858", "168591": "1909", 
"75367": "2568", "77666": "643", "79380": "244", "79381": "88", "81797": "315", 
"79384": "269", "274527": "4662", "79388": "196", "79389": "159", "73244": 
"458", "114711": "1533", "94821": "1704", "249164": "2657", "119761": "1608", 
"82696": "891", "248930": "2900", "268126": "4589", "248935": "3180", "
 248936": "3163", "76509": "638", "76467": "298", "95501": "1518", "220411": 
"3330", "93951": "1370", "81816": "1010", "239761": "2644", "194041": "3186", 
"85249": "1222", "260338": "4249", "75707": "262", "79337": "72", "79335": 
"179", "80222": "349", "79332": "285", "79331": "113", "77963": "296", 
"270481": "4227", "80144": "369", "212571": "2367", "79339": "115", "166091": 
"1852", "83734": "1057", "74922": "41", "81318": "690", "267014": "4260", 
"72135": "128", "258959": "3757", "79701": "132", "72241": "457", "221391": 
"2661", "174991": "2363", "258823": "3566", "163991": "2124", "267261": "4429", 
"79529": "92", "82109": "836", "80352": "543", "79875": "20", "79876": "249", 
"254143": "3183", "92521": "1250", "79871": "55", "84021": "1200", "106491": 
"1375", "80680": "588", "180461": "3354", "111381": "1864", "80137": "642", 
"248503": "3078", "230531": "2586", "275663": "4757", "259280": "3454", 
"258602": "3419", "252870": "3123", "247361": "2872", "78874": "3899", "82422": 
"818",
  "83427": "1027", "121431": "1679", "152651": "1798", "73141": "13", "95291": 
"1495", "80351": "395", "266609": "4161", "79506": "24", "70761": "57", 
"213221": "2423", "255677": "3272", "176941": "1961", "124051": "1669", 
"167571": "2540", "75914": "65", "80913": "625", "107631": "1983", "262407": 
"4799", "261690": "3984", "71969": "1821", "70860": "4838", "80435": "1060", 
"80223": "347", "253463": "3149", "164221": "2007", "72129": "679", "264085": 
"4310", "123581": "2300", "78581": "329", "81452": "704", "81525": "725", 
"259669": "4093", "98051": "1339", "110381": "1687", "73918": "336", "165381": 
"2004", "164541": "2065", "123411": "1660", "261284": "3541", "81289": "698", 
"81253": "686", "258616": "3588", "80671": "573", "259063": "4049", "167581": 
"2090", "82122": "1013", "75450": "198", "142861": "1813", "263711": "4256", 
"266189": "4383", "85228": "1179", "82492": "829", "76321": "632", "79183": 
"463", "82925": "767", "76738": "615", "164091": "2967", "79066": "143", 
"268943"
 : "4633", "273351": "4892", "196921": "2350", "79563": "756", "72201": "162", 
"83108": "925", "80481": "713", "187881": "2506", "237831": "3355", "81077": 
"646", "248651": "3139", "72920": "110", "261272": "3563", "267260": "4741", 
"134241": "1791", "254378": "4319", "204781": "3832", "175011": "2676", 
"77955": "234", "72108": "157", "248841": "3756", "72663": "2275", "81996": 
"770", "74608": "744", "258540": "4038", "258541": "3903", "267702": "4638", 
"72449": "220", "84084": "1209", "267258": "4876", "267259": "4442", "83025": 
"998", "158671": "1837", "258464": "4521", "75275": "366", "79842": "470", 
"164031": "2053", "213081": "2298", "80392": "423", "251539": "3003", "267951": 
"4174", "102491": "1402", "85075": "1159", "103321": "1384", "79481": "310", 
"80000": "1574", "80415": "414", "71691": "1330", "274337": "4759", "161511": 
"2347", "75546": "172", "259055": "3882", "163561": "2138", "108611": "1513", 
"82283": "988", "83028": "992", "249004": "3133", "81550": "729", "78902":
  "265", "78901": "224", "259702": "3714", "268591": "4591", "261656": "3559", 
"90571": "1242", "95751": "1335", "164501": "2153", "139941": "1948", "82670": 
"864", "80147": "307", "82672": "1041", "84926": "1130", "78465": "63", 
"73107": "267", "211681": "2512", "269586": "4405", "80301": "382", "71606": 
"388", "78261": "251", "248682": "2876", "275557": "4941", "75350": "3289", 
"264492": "4269", "82916": "971", "70851": "217", "217961": "3225", "80736": 
"634", "79925": "260", "94561": "1508", "73255": "52", "270814": "4758", 
"114461": "2703", "248884": "2807", "192061": "2281", "248880": "2941", 
"114701": "2547", "248393": "2592", "248394": "2576", "83602": "1109", "83258": 
"1598", "101271": "1353", "81487": "740", "82825": "1023", "75734": "183", 
"72158": "167", "260320": "4066", "194051": "2334", "248868": "2795", "159591": 
"1823", "260449": "4017", "258744": "3930", "173441": "1920", "80231": "82", 
"79324": "294", "79326": "141", "95041": "1816", "253073": "3213", "83463": 
"1101
 ", "248812": "3345", "164041": "2604", "95031": "1738", "82502": "861", 
"79988": "779", "79934": "164", "263724": "4587", "83708": "1054", "74156": 
"363", "76177": "2453", "79511": "1356", "85539": "1698", "76203": "1650", 
"259529": "4129", "134511": "1729", "80198": "440", "104641": "1413", "82459": 
"843", "269578": "4387", "226881": "2683", "79809": "174", "80042": "309", 
"80512": "537", "80215": "351", "129261": "3228", "79356": "1118", "94581": 
"1843", "75599": "259", "79352": "282", "186551": "2459", "81025": "653", 
"79216": "239", "76290": "5", "73871": "621", "182601": "2176", "252325": 
"3800", "168151": "2426", "164951": "2132", "83805": "1107", "258107": "4167", 
"83800": "1258", "95711": "1268", "93991": "1354", "72477": "241", "75125": 
"611", "81606": "1193", "77996": "580", "79635": "308", "82438": "825", 
"95491": "1500", "75128": "35", "81634": "769", "80463": "563", "80462": "494", 
"80461": "485", "94551": "1710", "82201": "793", "87851": "1223", "80344": 
"390", "80345"
 : "401", "161461": "2499", "251889": "3035", "74843": "200", "276312": "4889", 
"84500": "1132", "257454": "3981", "86241": "1288", "253556": "3168", "188011": 
"2454", "82642": "1034", "76924": "517", "263828": "3876", "79106": "109", 
"269650": "4904", "269651": "4852", "269653": "4420", "269654": "4513", 
"206751": "2509", "82091": "1265", "75340": "176", "258979": "3569", "255413": 
"3576", "252322": "3030", "80159": "190", "263365": "4430", "83066": "1001", 
"258604": "3509", "259071": "3971", "269895": "4689", "80649": "577", "80348": 
"408", "80644": "693", "95001": "1479", "82895": "932", "81365": "715", 
"79773": "613", "270633": "4756", "80270": "360", "81165": "697", "79177": 
"126", "81161": "1206", "83661": "1219", "83662": "1036", "81386": "799", 
"258773": "3987", "76568": "77", "95441": "1394", "76245": "637", "87621": 
"1240", "257630": "4001", "80494": "466", "79647": "229", "260315": "4088", 
"75760": "100", "260313": "3990", "259007": "3852", "79255": "90", "73730": 
"287", "
 259009": "3613", "76143": "117", "175001": "2666", "142561": "1784", "74058": 
"797", "101341": "1311", "99801": "1313", "80246": "375", "82230": "815", 
"249361": "2964", "75863": "3076", "249081": "3083", "83226": "1025", "84390": 
"1093", "82046": "1137", "248793": "2882", "70900": "605", "80426": "482", 
"80424": "473", "219341": "2484", "80421": "562", "80385": "519", "80381": 
"455", "162071": "1898", "73739": "134", "80547": "475", "80542": "499", 
"257377": "3412"}
\ No newline at end of file
diff --git a/service.subtitles.itasa/resources/language/English/strings.xml 
b/service.subtitles.itasa/resources/language/English/strings.xml
index 1a5569d..88c7728 100644
--- a/service.subtitles.itasa/resources/language/English/strings.xml
+++ b/service.subtitles.itasa/resources/language/English/strings.xml
@@ -6,8 +6,11 @@
     <string id="32001">Username</string>
     <string id="32002">Password</string>
     <string id="32003">Login Details</string>
-    <string id="32004">Login to ItaSA failed. Check your username and password 
in addon settings</string>
-    <string id="32005">ItaSA has only italian subtitles. Add italian to the 
subtitle settings</string>
-    <string id="32006">ItaSA only works with tv shows subtitles</string>
-       <string id="32007">Download link not found in ItaSA subtitle page. 
Downloaded too many times?</string>
+       <string id="32004">Username or password missing. Insert them in the 
addon settings</string>
+    <string id="32005">Login to ItaSA api failed. Check your username and 
password in addon settings</string>  
+    <string id="32006">Login to ItaSA failed. Check your username and password 
in addon settings</string>
+       <string id="32007">Error opening ItaSA website</string>
+    <string id="32008">ItaSA has only italian subtitles. Add italian to the 
subtitle settings</string>
+    <string id="32009">ItaSA only works with tv shows subtitles</string>
+       <string id="32010">Subtitle downloaded too many times</string>
 </strings>
diff --git a/service.subtitles.itasa/resources/language/Italian/strings.xml 
b/service.subtitles.itasa/resources/language/Italian/strings.xml
index 3234d9c..c053655 100644
--- a/service.subtitles.itasa/resources/language/Italian/strings.xml
+++ b/service.subtitles.itasa/resources/language/Italian/strings.xml
@@ -6,8 +6,11 @@
     <string id="32001">Nome utente</string>
     <string id="32002">Password</string>
     <string id="32003">Dettagli login</string>
-    <string id="32004">Login a ItaSA fallito. Controlla il tuo username e la 
tua password nelle impostazioni dell'addon</string>
-       <string id="32005">ItaSA ha solo sottotitoli italiani. Aggiungete 
l'italiano nelle impostazioni sottotitoli..</string>
-       <string id="32006">ItaSA funziona solo con sottotitoli di serie 
tv</string>
-       <string id="32007">Download link non trovato nella pagina ItaSA del 
sottotitolo. Già scaricato più di 10 volte?</string>
+    <string id="32004">Username o password mancanti. Inserirle nelle 
impostazioni dell'addon</string>
+    <string id="32005">Login a ItaSA con api fallito. Controlla il tuo 
username e la tua password nelle impostazioni dell'addon</string>
+    <string id="32006">Login a ItaSA fallito. Controlla il tuo username e la 
tua password nelle impostazioni dell'addon</string>
+    <string id="32007">Errore durante l'apertura del sito ItaSA</string>
+       <string id="32008">ItaSA ha solo sottotitoli italiani. Aggiungete 
l'italiano nelle impostazioni sottotitoli</string>
+       <string id="32009">ItaSA funziona solo con sottotitoli di serie 
tv</string>
+       <string id="32010">Sottotitolo scaricato troppe volte</string>
 </strings>
diff --git a/service.subtitles.itasa/service.py 
b/service.subtitles.itasa/service.py
index 897205f..9cdf248 100644
--- a/service.subtitles.itasa/service.py
+++ b/service.subtitles.itasa/service.py
@@ -174,8 +174,8 @@ def getItaSATVShowID(tvshow, onlineid):
                        else:
                                log(__name__,'Download tv show list and search 
for new tv shows')
                                missingseries = {}
-                               content = getItaSATVShowList()
-                               if content:
+                               result = getItaSATVShowList()
+                               if result:
                                        for (tvshowid, tvshowname) in result:
                                                if not (tvshowid in 
series.values()):
                                                        newid = 
getItaSATheTVDBID(tvshowid)
@@ -213,17 +213,38 @@ def getItaSATVShowID(tvshow, onlineid):
        else:
                return None
 
-def login(username, password):
-       log( __name__ , "Logging in with username '%s' ..." % (username))
+
+def getAuthID():
+       username = __addon__.getSetting( 'ITuser' )
+       password = __addon__.getSetting( 'ITpass' )
+       authid = ''
+       if (username == '' or password == ''):
+               xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , 
__language__(32004))).encode('utf-8'))
+               log( __name__ ,'Missing username or password. Login to Itasa 
failed.')
+               return ''
+       else:
+               log( __name__ , "Logging in with username '%s' ..." % 
(username))
+               oldusername = __addon__.getSetting( 'ITLoggeduser' )
+               authid = __addon__.getSetting( 'authid' )
+               if (authid =='' or oldusername != username):
+                       content = 
geturl('https://api.italiansubs.net/api/rest/users/login?username=' + username 
+ '&password=' + password + '&apikey=4ffc34b31af2bca207b7256483e24aac')
+                       match = re.findall(r'<authcode>([\s\S]*?)</authcode>', 
content, re.IGNORECASE | re.DOTALL)
+                       if match and match[0]!='':
+                               authid=match[0]
+                               __addon__.setSetting(id="ITLoggeduser", 
value=username)
+                               __addon__.setSetting(id="authid", value=authid)
+                       else:
+                               xbmc.executebuiltin((u'Notification(%s,%s)' % 
(__scriptname__ , __language__(32005))).encode('utf-8'))
+                               log( __name__ ,'Login to Itasa api failed. 
Check your username/password at the addon configuration')
+                               return ''
        content= geturl(main_url + 'index.php')
        if content is not None:
                match = re.search('logouticon.png', content, re.IGNORECASE | 
re.DOTALL)
                if match:
-                       return 1
+                       return authid
                else:
                        match = re.search('<input type="hidden" name="return" 
value="([^\n\r\t ]+?)" /><input type="hidden" name="([^\n\r\t ]+?)" 
value="([^\n\r\t ]+?)" />', content, re.IGNORECASE | re.DOTALL)
                        if match:
-                               
                                return_value = match.group(1)
                                unique_name = match.group(2)
                                unique_value = match.group(3)
@@ -236,13 +257,17 @@ def login(username, password):
                                response = urllib2.urlopen(request).read()
                                match = re.search('logouticon.png', response, 
re.IGNORECASE | re.DOTALL)
                                if match:
-                                       return 1
+                                       return authid
                                else:
-                                       return 0
+                                       
xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , 
__language__(32006))).encode('utf-8'))
+                                       log( __name__ ,'Login to Itasa failed. 
Check your username/password at the addon configuration')
+                                       return ''
        else:
-               return 0
+               xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , 
__language__(32007))).encode('utf-8'))
+               log( __name__ ,'Error loading itasa page. Login to Itasa 
failed')
+               return ''
 
-def append_subtitle(subid, subtitlename, filename, sync):
+def append_subtitle(subid, subtitlename, filename, sync, count):
        listitem = xbmcgui.ListItem(label='Italian',
                                                                
label2=subtitlename,
                                                                
thumbnailImage='it')
@@ -252,7 +277,7 @@ def append_subtitle(subid, subtitlename, filename, sync):
 
        ## below arguments are optional, it can be used to pass any info needed 
in download function
        ## anything after "action=download&" will be sent to addon once user 
clicks listed subtitle to downlaod
-       url = "plugin://%s/?action=download&subid=%s&filename=%s" % 
(__scriptid__, subid, filename)
+       url = "plugin://%s/?action=download&count=%s&subid=%s&filename=%s" % 
(__scriptid__, count, subid, filename)
        ## add it to list, this can be done as many times as needed for all 
subtitles found
        log(__name__,"Adding subtitle '%s' to gui list" % subtitlename)
        xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = url, 
listitem = listitem, isFolder = False)
@@ -267,12 +292,12 @@ def search(item):
                elif item['tvshow']:
                        search_tvshow(item['tvshow'], item['season'], 
item['episode'], item['onlineid'], filename, True)
                elif item['title'] and item['year']:
-                       xbmc.executebuiltin((u'Notification(%s,%s)' % 
(__scriptname__ , __language__(32006))).encode('utf-8'))
+                       xbmc.executebuiltin((u'Notification(%s,%s)' % 
(__scriptname__ , __language__(32009))).encode('utf-8'))
                        log(__name__, 'Itasa only works with tv shows. Skipped')
                else:
                        search_filename(filename, False)
        else:
-               xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , 
__language__(32005))).encode('utf-8'))
+               xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , 
__language__(32008))).encode('utf-8'))
                log(__name__, 'Itasa only works with italian. Skipped')
        
 def search_tvshow(tvshow, season, episode, onlineid, filename, allowfallback):
@@ -316,30 +341,33 @@ def search_manual(searchstr, filename):
 
 def checksyncandadd(result, filename):
        fl = filename.lower()
+       count=0
        for (subtitleid, subtitlename, subtitleversion) in result:
                if subtitleversion == 'WEB-DL':                                 
        
                        if ('web-dl' in fl) or ('web.dl' in fl) or ('webdl' in 
fl) or ('web dl' in fl):
-                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, True)
+                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, True, count)
                elif subtitleversion == '720p':                                 
        
                        if ('720p' in fl) and ('hdtv' in fl):
-                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, True)
+                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, True, count)
                elif subtitleversion == 'Normale':
                        if ('hdtv' in fl) and ( not ('720p' in fl)):
-                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, True)
+                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, True, count)
                elif subtitleversion.lower() in fl:
-                       append_subtitle(subtitleid, subtitlename + ' ' + 
subtitleversion, filename, True)
+                       append_subtitle(subtitleid, subtitlename + ' ' + 
subtitleversion, filename, True, count)
+               count +=1
        for (subtitleid, subtitlename, subtitleversion) in result:
                if subtitleversion == 'WEB-DL':                                 
        
                        if not (('web-dl' in fl) or ('web.dl' in fl) or 
('webdl' in fl) or ('web dl' in fl)):
-                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, True)
+                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, False, count)
                elif subtitleversion == '720p':
                        if not (('720p' in fl) and ('hdtv' in fl)):
-                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, False)
+                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, False, count)
                elif subtitleversion == 'Normale':
                        if not (('hdtv' in fl) and ( not ('720p' in fl))):
-                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, False)
+                               append_subtitle(subtitleid, subtitlename + ' ' 
+ subtitleversion, filename, False, count)
                elif not (subtitleversion.lower() in fl):
-                       append_subtitle(subtitleid, subtitlename + ' ' + 
subtitleversion, filename, False)
+                       append_subtitle(subtitleid, subtitlename + ' ' + 
subtitleversion, filename, False, count)
+               count +=1
 
 def search_filename(filename, allowfallback):
        log(__name__, 'Search tv show using the file name')
@@ -362,92 +390,80 @@ def search_filename(filename, allowfallback):
                        log(__name__, 'Unable to retrieve a tv show name and 
episode from file name')
 
 def download (subid): #standard input
-       username = __addon__.getSetting( 'ITuser' )
-       password = __addon__.getSetting( 'ITpass' )
-       if login(username, password):
-               log( __name__ , ' Login successful')
-               content= geturl(main_url + 
'index.php?option=com_remository&Itemid=6&func=fileinfo&id='+subid)
+       authid = getAuthID()
+       if authid != '':
+               url = 
'https://api.italiansubs.net/api/rest/subtitles/download?authcode=' + authid + 
'&subtitle_id=' + subid + '&apikey=4ffc34b31af2bca207b7256483e24aac'
+               log( __name__ ,"Fetching subtitles using url %s" % url)
+               content= geturl(url)
                if content:
-                       match = re.search('<a 
href="http://www\.italiansubs\.net/(index\.php\?option=com_remository&amp;Itemid=\d+?&amp;func=download&amp;id=%s&amp;chk=[^\n\r\t
 ]+?&amp;no_html=1")' % subid, content, re.IGNORECASE | re.DOTALL)
-                       if match:
-                               log( __name__ ,"Fetching subtitles using url 
%s" % (main_url + match.group(1)))
-                               content= geturl(main_url + match.group(1))
-                               if content:
-                                       log(__name__, 'Found download url')
-                                       try:
-                                               if xbmcvfs.exists(__temp__):
-                                                       shutil.rmtree(__temp__)
-                                               xbmcvfs.mkdirs(__temp__)
-                                       except:
-                                               log(__name__, 'Failed to 
download the temp folder')
-                                       local_tmp_file = os.path.join(__temp__, 
'itasa.xxx')
-                                       
-                                       try:
-                                               log(__name__, "Saving subtitles 
to '%s'" % local_tmp_file)
-                                               local_file_handle = 
open(local_tmp_file, 'wb')
-                                               local_file_handle.write(content)
-                                               local_file_handle.close()
-
-                                               #Check archive type 
(rar/zip/else) through the file header (rar=Rar!, zip=PK)
-                                               myfile = open(local_tmp_file, 
'rb')
+                       log(__name__, 'File downloaded')
+                       try:
+                               if xbmcvfs.exists(__temp__):
+                                       shutil.rmtree(__temp__)
+                               xbmcvfs.mkdirs(__temp__)
+                       except:
+                               log(__name__, 'Failed to delete the temp 
folder')
+                       local_tmp_file = os.path.join(__temp__, 'itasa.xxx')
+                       
+                       try:
+                               log(__name__, "Saving subtitles to '%s'" % 
local_tmp_file)
+                               local_file_handle = open(local_tmp_file, 'wb')
+                               local_file_handle.write(content)
+                               local_file_handle.close()
+                               #Check archive type (rar/zip/else) through the 
file header (rar=Rar!, zip=PK)
+                               myfile = open(local_tmp_file, 'rb')
+                               myfile.seek(0)
+                               if myfile.read(1) == 'R':
+                                       typeid = 'rar'
+                                       packed = True
+                                       log(__name__, 'Discovered RAR Archive')
+                               else:
+                                       myfile.seek(0)
+                                       if myfile.read(1) == 'P':
+                                               typeid = 'zip'
+                                               packed = True
+                                               log(__name__, 'Discovered ZIP 
Archive')
+                                       else:
                                                myfile.seek(0)
-                                               if myfile.read(1) == 'R':
-                                                       typeid = 'rar'
-                                                       packed = True
-                                                       log(__name__, 
'Discovered RAR Archive')
+                                               if myfile.read(92) != 
'<br/>&nbsp;<br/> Spiacente il tuo limite di download per questo file &egrave 
stato raggiunto':
+                                                       typeid = 'srt'
+                                                       packed = False
+                                                       log(__name__, 
'Discovered a non-archive file')
                                                else:
-                                                       myfile.seek(0)
-                                                       if myfile.read(1) == 
'P':
-                                                               typeid = 'zip'
-                                                               packed = True
-                                                               log(__name__, 
'Discovered ZIP Archive')
-                                                       else:
-                                                               typeid = 'srt'
-                                                               packed = False
-                                                               log(__name__, 
'Discovered a non-archive file')
-                                               myfile.close()
-                                               local_tmp_file = 
os.path.join(__temp__, 'itasa.' + typeid)
-                                               
os.rename(os.path.join(__temp__, 'itasa.xxx'), local_tmp_file)
-                                               log(__name__, "Saving to %s" % 
local_tmp_file)
-                                       except:
-                                               log(__name__, "Failed to save 
subtitle to %s" % local_tmp_file)
-                                       if packed:
-                                               xbmc.sleep(500)
-                                               
xbmc.executebuiltin(('XBMC.Extract(' + local_tmp_file + ',' + __temp__ 
+')').encode('utf-8'), True)
-                                               files = []
-                                               exts = ['.srt', '.sub', '.txt', 
'.smi', '.ssa', '.ass']
-                                               tag = True
-                                               log(__name__, 'Check if file 
contains tags in srt and if not returns it')
-                                               for file in 
os.listdir(__temp__):
-                                                       if '.tag.' not in 
file.lower() and os.path.splitext(file)[1] in exts:
-                                                               
files.append(os.path.join(__temp__, file))
-                                                               if tag and 
'.notag.' in file.lower():
-                                                                       tag = 
False
-                                               if tag:
-                                                       return files
-                                               else:
-                                                       files2 = []
-                                                       for file in files:
-                                                               if not 
('.notag.' not in file.lower() and os.path.splitext(file)[1]=='.srt'):
-                                                                       
files2.append(file)
-                                                       return files2
-                                       else:
-                                               return [local_tmp_file]
+                                                       
xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , 
__language__(32010))).encode('utf-8'))
+                                                       log( __name__ 
,'Subtitle downloaded too many times.')
+                                                       return []
+                               myfile.close()
+                               local_tmp_file = os.path.join(__temp__, 
'itasa.' + typeid)
+                               os.rename(os.path.join(__temp__, 'itasa.xxx'), 
local_tmp_file)
+                               log(__name__, "Saving to %s" % local_tmp_file)
+                       except:
+                               log(__name__, "Failed to save subtitle to %s" % 
local_tmp_file)
+                       if packed:
+                               xbmc.sleep(500)
+                               xbmc.executebuiltin(('XBMC.Extract(' + 
local_tmp_file + ',' + __temp__ +')').encode('utf-8'), True)
+                               files = []
+                               exts = ['.srt', '.sub', '.txt', '.smi', '.ssa', 
'.ass']
+                               tag = True
+                               log(__name__, 'Check if file contains tags in 
srt and if not returns it')
+                               for file in os.listdir(__temp__):
+                                       if '.tag.' not in file.lower() and 
os.path.splitext(file)[1] in exts:
+                                               
files.append(os.path.join(__temp__, file))
+                                               if tag and '.notag.' in 
file.lower():
+                                                       tag = False
+                               if tag:
+                                       return files
                                else:
-                                       log( __name__ ,'Failed to download the 
file')
+                                       files2 = []
+                                       for file in files:
+                                               if not ('.notag.' not in 
file.lower() and os.path.splitext(file)[1]=='.srt'):
+                                                       files2.append(file)
+                                       return files2
                        else:
-                               match = re.search('logouticon.png', content, 
re.IGNORECASE | re.DOTALL)
-                               if match:
-                                       
xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , 
__language__(32007))).encode('utf-8'))
-                                       log( __name__ ,'Can\'t find the 
download url. Probably you downloaded the file too many times (more than 10)')
-                               else:
-                                       log( __name__ ,'Can\'t find the 
download url. Probably not logged in')
+                               return [local_tmp_file]
                else:
-                       log( __name__ ,'Download of subtitle page failed')
-       else:
-               xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , 
__language__(32004))).encode('utf-8'))
-               log( __name__ ,'Login to Itasa failed. Check your 
username/password at the addon configuration')
-       return []
+                       log( __name__ ,'Failed to download the file')
+                       return []
 
 log(__name__, "Application version: %s" % __version__)
 if not xbmcvfs.exists(__profile__):

-----------------------------------------------------------------------

Summary of changes:
 service.subtitles.itasa/addon.xml                  |    2 +-
 service.subtitles.itasa/changelog.txt              |    6 +
 service.subtitles.itasa/resources/Serie.json       |  723 +-------------------
 .../resources/language/English/strings.xml         |   11 +-
 .../resources/language/Italian/strings.xml         |   11 +-
 service.subtitles.itasa/service.py                 |  218 ++++---
 6 files changed, 139 insertions(+), 832 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to