Beispiel #1
0
 public static string GetItemDownloadPageUrl(
     this InternetArchiveItem @this)
 {
     return($"https://www.archive.org/" +
            $"download/" +
            $"{@this.Identifier}/");
 }
Beispiel #2
0
 public static IReadOnlyList <InternetArchiveFile> GetItemThumbnailFiles(
     this InternetArchiveItem @this)
 {
     return(ArchiveFileInterpreter.ScrapeArchiveThumbnailFiles(@this)
            .Where(t => t.FilePathUrl.EndsWith(".jpg"))
            .ToArray());
 }
Beispiel #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;
        }
Beispiel #4
0
 public static IReadOnlyList <InternetArchiveFile> GetItemFiles(
     this InternetArchiveItem @this)
 {
     return(ArchiveFileInterpreter.ScrapeArchiveFiles(@this)
            .ToArray());
 }