Esempio n. 1
0
        public string ExtractTitle()
        {
            string startTag = "<span id=\"eow-title\" class=\"\" dir=\"ltr\" title=\"";
            string endTag = "\">";

            SlicableString slicey = new SlicableString(_youTubeVideoHtmlSourceCode);

            return slicey.Slice(startTag, endTag);
        }
Esempio n. 2
0
        public string GetMarkedRange()
        {
            string rangeIncludingMarkings = _originalValue.Substring(_startMarking.Position, _endMarking.Position  - _startMarking.Position + _endMarking.Length);

            SlicableString slicey = new SlicableString(rangeIncludingMarkings);
            string rangeWithoutMarkings = slicey.Slice(_startMarking.Value, _endMarking.Value);

            return rangeWithoutMarkings;
        }
Esempio n. 3
0
        public string ExtractDirectDownloadLink()
        {
            // First step: Get the Flash Variables.
            SlicableString originalSource = new SlicableString(_youTubeVideoHtmlSourceCode);

            string flashVars = originalSource.Slice("flashvars=\"", "\" ");

            // Second step: Get a list of download urls using the scent of the "videoplayback" keyword.
            var urlextractor = new UrlExtractorStrategy();

            string link = urlextractor.Extract(flashVars);

            return link;
        }