protected string[] AddTumblrVideoUrl(string text, Post post)
        {
            if (!Blog.DownloadVideo)
            {
                return(Array.Empty <string>());
            }

            var list = new List <string>();

            foreach (string videoUrl in TumblrParser.SearchForTumblrVideoUrl(text))
            {
                string url = videoUrl;
                if (ShellService.Settings.VideoSize == 480)
                {
                    url += "_480";
                }

                url = "https://vtt.tumblr.com/" + url + ".mp4";
                var filename = BuildFileName(url, post, -1);
                AddDownloadedMedia(url, filename, post);
                AddToDownloadList(new VideoPost(url, post.Id, post.UnixTimestamp.ToString(), filename));
                list.Add(url);
            }

            return(list.ToArray());
        }
Пример #2
0
        protected void AddTumblrVideoUrl(string post)
        {
            foreach (string videoUrl in TumblrParser.SearchForTumblrVideoUrl(post))
            {
                string url = videoUrl;
                if (ShellService.Settings.VideoSize == 480)
                {
                    url += "_480";
                }

                AddToDownloadList(new VideoPost("https://vtt.tumblr.com/" + url + ".mp4", Guid.NewGuid().ToString("N")));
            }
        }
Пример #3
0
        protected void AddTumblrVideoUrl(string post, int?postTimestamp)
        {
            foreach (string videoUrl in TumblrParser.SearchForTumblrVideoUrl(post))
            {
                string url = videoUrl;
                if (ShellService.Settings.VideoSize == 480)
                {
                    url += "_480";
                }

                AddToDownloadList(new VideoPost("https://vtt.tumblr.com/" + url + ".mp4", Guid.NewGuid().ToString("N"), postTimestamp?.ToString(), BuildFileName("https://vtt.tumblr.com/" + url + ".mp4", (Post)null, -1)));
            }
        }
Пример #4
0
        protected void AddTumblrVideoUrl(string text, Post post)
        {
            foreach (string videoUrl in TumblrParser.SearchForTumblrVideoUrl(text))
            {
                string url = videoUrl;
                if (ShellService.Settings.VideoSize == 480)
                {
                    url += "_480";
                }

                AddToDownloadList(new VideoPost("https://vtt.tumblr.com/" + url + ".mp4", post.Id, post.UnixTimestamp.ToString(), BuildFileName("https://vtt.tumblr.com/" + url + ".mp4", post, -1)));
            }
        }