예제 #1
0
 public static string GetItemDownloadPageUrl(
     this InternetArchiveItem @this)
 {
     return($"https://www.archive.org/" +
            $"download/" +
            $"{@this.Identifier}/");
 }
예제 #2
0
 public static IReadOnlyList <InternetArchiveFile> GetItemThumbnailFiles(
     this InternetArchiveItem @this)
 {
     return(ArchiveFileInterpreter.ScrapeArchiveThumbnailFiles(@this)
            .Where(t => t.FilePathUrl.EndsWith(".jpg"))
            .ToArray());
 }
예제 #3
0
        public InternetArchiveFile(
            [NotNull] InternetArchiveItem ownerArchiveItem,
            [NotNull] string fileName,
            [NotNull] IAFileKind fileKind,
            [NotNull] string title,
            DateTime lastModifiedDate,
            double approximateBytes,
            int indexWithinItem,
            bool isThumbnailFile = false)
        {
            ownerArchiveItem.IsNotNull(nameof(ownerArchiveItem));
            fileName.IsNotNull(nameof(fileName));
            fileKind.IsNotNull(nameof(fileKind));
            title.IsNotNull(nameof(title));

            OwnerArchiveItem = ownerArchiveItem;
            FileName         = fileName;
            FileKind         = fileKind;
            Title            = title;
            IndexWithinItem  = indexWithinItem;

            if (isThumbnailFile)
            {
                FilePathUrl = $"{ownerArchiveItem.GetItemThumbnailDownloadPageUrl()}{fileName}";
            }
            else
            {
                FilePathUrl = $"{ownerArchiveItem.GetItemDownloadPageUrl()}{fileName}";
            }

            LastModifiedDate = lastModifiedDate;
            ApproximateBytes = approximateBytes;
        }
예제 #4
0
 public static IReadOnlyList <InternetArchiveFile> GetItemFiles(
     this InternetArchiveItem @this)
 {
     return(ArchiveFileInterpreter.ScrapeArchiveFiles(@this)
            .ToArray());
 }