File size: 2,163 Bytes
e26fba6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;
using System.Xml;
using System.Web;
using HtmlAgilityPack;

namespace MovieTube.Client.Scraper
{
    public class FireDrive : VideoScraperBase
    {
        protected override string OnScrape(string url, HtmlNode elem)
        {
            try
            {
                var item = SelectItem(elem, "#top_external_download");
                url = item.Attributes["href"].Value;

                return url;
            }
            catch { }

            var hash = SelectItem(elem, "[name=confirm]").Attributes["value"].Value;
            var data = new NameValueCollection();
            data.Add("confirm", hash);
            elem = Post(url, data);
            {
                var item = SelectItem(elem, "#fd_vid_btm_download");
                url = item.Attributes["href"].Value;
            }

            return url;
        }

        public override string RootUrl
        {
            get { return "http://www.firedrive.com"; }
        }

        public override string ID
        {
            get { return ScrapperId.FireDrive; }
        }

        public override string Title
        {
            get { return "FireDrive"; }
        }

        public override bool CanProcess(string url)
        {
            if (base.CanProcess(url))
                return true;
            return url.ToLower().Contains("putlocker.com") ||
                url.ToLower().Contains("firedrive.com");
        }
        public override string SanitizeUrl(string url)
        {
            url = url.Replace("https", "http");
            url = url.Replace("www.putlocker.com", "www.firedrive.com");

            if (url.Contains("embed/"))
            {
                url = String.Format("http://www.firedrive.com/file/{0}", SubstringBetween(url, "embed/"));
            }
            return url;
        }

        public override ScraperRank Rank
        {
            get
            {
                return  ScraperRank.FireDrive;
            }
        }
    }
}