Refactor Message entities into DTOs and application entities with standardized naming conventions and default values
This commit is contained in:
parent
911f98bc25
commit
d8794ee219
@ -1,6 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Lists;
|
||||
namespace OF_DL.Models.Dtos.Common;
|
||||
|
||||
public class AvatarThumbsDto
|
||||
{
|
||||
10
OF DL/Models/Dtos/Common/HeaderSizeDto.cs
Normal file
10
OF DL/Models/Dtos/Common/HeaderSizeDto.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Common;
|
||||
|
||||
public class HeaderSizeDto
|
||||
{
|
||||
[JsonProperty("width")] public int Width { get; set; }
|
||||
|
||||
[JsonProperty("height")] public int Height { get; set; }
|
||||
}
|
||||
10
OF DL/Models/Dtos/Common/HeaderThumbsDto.cs
Normal file
10
OF DL/Models/Dtos/Common/HeaderThumbsDto.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Common;
|
||||
|
||||
public class HeaderThumbsDto
|
||||
{
|
||||
[JsonProperty("w480")] public string W480 { get; set; } = "";
|
||||
|
||||
[JsonProperty("w760")] public string W760 { get; set; } = "";
|
||||
}
|
||||
8
OF DL/Models/Dtos/Common/VideoDto.cs
Normal file
8
OF DL/Models/Dtos/Common/VideoDto.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Common;
|
||||
|
||||
public class VideoDto
|
||||
{
|
||||
[JsonProperty("mp4")] public string Mp4 { get; set; } = "";
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using OF_DL.Models.Dtos.Common;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Lists;
|
||||
|
||||
@ -54,8 +55,7 @@ public class UsersListDto
|
||||
|
||||
[JsonProperty("subscribePrice")] public string? SubscribePrice { get; set; }
|
||||
|
||||
[JsonProperty("subscriptionBundles")]
|
||||
public List<SubscriptionBundleDto> SubscriptionBundles { get; set; } = [];
|
||||
[JsonProperty("subscriptionBundles")] public List<SubscriptionBundleDto> SubscriptionBundles { get; set; } = [];
|
||||
|
||||
[JsonProperty("displayName")] public string DisplayName { get; set; } = "";
|
||||
|
||||
@ -77,23 +77,29 @@ public class UsersListDto
|
||||
|
||||
[JsonProperty("subscribedByExpire")] public bool? SubscribedByExpire { get; set; }
|
||||
|
||||
[JsonProperty("subscribedByExpireDate")] public DateTime? SubscribedByExpireDate { get; set; }
|
||||
[JsonProperty("subscribedByExpireDate")]
|
||||
public DateTime? SubscribedByExpireDate { get; set; }
|
||||
|
||||
[JsonProperty("subscribedByAutoprolong")] public bool? SubscribedByAutoprolong { get; set; }
|
||||
[JsonProperty("subscribedByAutoprolong")]
|
||||
public bool? SubscribedByAutoprolong { get; set; }
|
||||
|
||||
[JsonProperty("subscribedIsExpiredNow")] public bool? SubscribedIsExpiredNow { get; set; }
|
||||
[JsonProperty("subscribedIsExpiredNow")]
|
||||
public bool? SubscribedIsExpiredNow { get; set; }
|
||||
|
||||
[JsonProperty("currentSubscribePrice")] public string? CurrentSubscribePrice { get; set; }
|
||||
[JsonProperty("currentSubscribePrice")]
|
||||
public string? CurrentSubscribePrice { get; set; }
|
||||
|
||||
[JsonProperty("subscribedOn")] public bool? SubscribedOn { get; set; }
|
||||
|
||||
[JsonProperty("subscribedOnExpiredNow")] public bool? SubscribedOnExpiredNow { get; set; }
|
||||
[JsonProperty("subscribedOnExpiredNow")]
|
||||
public bool? SubscribedOnExpiredNow { get; set; }
|
||||
|
||||
[JsonProperty("subscribedOnDuration")] public string SubscribedOnDuration { get; set; } = "";
|
||||
|
||||
[JsonProperty("canReport")] public bool? CanReport { get; set; }
|
||||
|
||||
[JsonProperty("canReceiveChatMessage")] public bool? CanReceiveChatMessage { get; set; }
|
||||
[JsonProperty("canReceiveChatMessage")]
|
||||
public bool? CanReceiveChatMessage { get; set; }
|
||||
|
||||
[JsonProperty("hideChat")] public bool? HideChat { get; set; }
|
||||
|
||||
|
||||
98
OF DL/Models/Dtos/Messages/FromUserDto.cs
Normal file
98
OF DL/Models/Dtos/Messages/FromUserDto.cs
Normal file
@ -0,0 +1,98 @@
|
||||
using Newtonsoft.Json;
|
||||
using OF_DL.Models.Dtos.Common;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Messages;
|
||||
|
||||
public class FromUserDto
|
||||
{
|
||||
[JsonProperty("_view")] public string ViewRaw { get; set; } = "";
|
||||
|
||||
[JsonProperty("view")] public string View { get; set; } = "";
|
||||
|
||||
[JsonProperty("avatar")] public string Avatar { get; set; } = "";
|
||||
|
||||
[JsonProperty("avatarThumbs")] public AvatarThumbsDto AvatarThumbs { get; set; } = new();
|
||||
|
||||
[JsonProperty("header")] public string Header { get; set; } = "";
|
||||
|
||||
[JsonProperty("headerSize")] public HeaderSizeDto HeaderSize { get; set; } = new();
|
||||
|
||||
[JsonProperty("headerThumbs")] public HeaderThumbsDto HeaderThumbs { get; set; } = new();
|
||||
|
||||
[JsonProperty("id")] public long? Id { get; set; }
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
|
||||
[JsonProperty("username")] public string Username { get; set; } = "";
|
||||
|
||||
[JsonProperty("canLookStory")] public bool CanLookStory { get; set; }
|
||||
|
||||
[JsonProperty("canCommentStory")] public bool CanCommentStory { get; set; }
|
||||
|
||||
[JsonProperty("hasNotViewedStory")] public bool HasNotViewedStory { get; set; }
|
||||
|
||||
[JsonProperty("isVerified")] public bool IsVerified { get; set; }
|
||||
|
||||
[JsonProperty("canPayInternal")] public bool CanPayInternal { get; set; }
|
||||
|
||||
[JsonProperty("hasScheduledStream")] public bool HasScheduledStream { get; set; }
|
||||
|
||||
[JsonProperty("hasStream")] public bool HasStream { get; set; }
|
||||
|
||||
[JsonProperty("hasStories")] public bool HasStories { get; set; }
|
||||
|
||||
[JsonProperty("tipsEnabled")] public bool TipsEnabled { get; set; }
|
||||
|
||||
[JsonProperty("tipsTextEnabled")] public bool TipsTextEnabled { get; set; }
|
||||
|
||||
[JsonProperty("tipsMin")] public int TipsMin { get; set; }
|
||||
|
||||
[JsonProperty("tipsMinInternal")] public int TipsMinInternal { get; set; }
|
||||
|
||||
[JsonProperty("tipsMax")] public int TipsMax { get; set; }
|
||||
|
||||
[JsonProperty("canEarn")] public bool CanEarn { get; set; }
|
||||
|
||||
[JsonProperty("canAddSubscriber")] public bool CanAddSubscriber { get; set; }
|
||||
|
||||
[JsonProperty("subscribePrice")] public string SubscribePrice { get; set; } = "";
|
||||
|
||||
[JsonProperty("subscriptionBundles")] public List<object> SubscriptionBundles { get; set; } = [];
|
||||
|
||||
[JsonProperty("isPaywallRequired")] public bool IsPaywallRequired { get; set; }
|
||||
|
||||
[JsonProperty("listsStates")] public List<ListsStateDto> ListsStates { get; set; } = [];
|
||||
|
||||
[JsonProperty("isRestricted")] public bool IsRestricted { get; set; }
|
||||
|
||||
[JsonProperty("canRestrict")] public bool CanRestrict { get; set; }
|
||||
|
||||
[JsonProperty("subscribedBy")] public object SubscribedBy { get; set; } = new();
|
||||
|
||||
[JsonProperty("subscribedByExpire")] public object SubscribedByExpire { get; set; } = new();
|
||||
|
||||
[JsonProperty("subscribedByExpireDate")]
|
||||
public DateTime? SubscribedByExpireDate { get; set; }
|
||||
|
||||
[JsonProperty("subscribedByAutoprolong")]
|
||||
public object SubscribedByAutoprolong { get; set; } = new();
|
||||
|
||||
[JsonProperty("subscribedIsExpiredNow")]
|
||||
public bool SubscribedIsExpiredNow { get; set; }
|
||||
|
||||
[JsonProperty("currentSubscribePrice")]
|
||||
public object CurrentSubscribePrice { get; set; } = new();
|
||||
|
||||
[JsonProperty("subscribedOn")] public object SubscribedOn { get; set; } = new();
|
||||
|
||||
[JsonProperty("subscribedOnExpiredNow")]
|
||||
public object SubscribedOnExpiredNow { get; set; } = new();
|
||||
|
||||
[JsonProperty("subscribedOnDuration")] public object SubscribedOnDuration { get; set; } = new();
|
||||
|
||||
[JsonProperty("callPrice")] public int CallPrice { get; set; }
|
||||
|
||||
[JsonProperty("lastSeen")] public DateTime? LastSeen { get; set; }
|
||||
|
||||
[JsonProperty("canReport")] public bool CanReport { get; set; }
|
||||
}
|
||||
11
OF DL/Models/Dtos/Messages/InfoDto.cs
Normal file
11
OF DL/Models/Dtos/Messages/InfoDto.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using Newtonsoft.Json;
|
||||
using OF_DL.Models.Dtos.Common;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Messages;
|
||||
|
||||
public class InfoDto
|
||||
{
|
||||
[JsonProperty("source")] public SourceDto Source { get; set; } = new();
|
||||
|
||||
[JsonProperty("preview")] public PreviewDto Preview { get; set; } = new();
|
||||
}
|
||||
66
OF DL/Models/Dtos/Messages/ListItemDto.cs
Normal file
66
OF DL/Models/Dtos/Messages/ListItemDto.cs
Normal file
@ -0,0 +1,66 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Messages;
|
||||
|
||||
public class ListItemDto
|
||||
{
|
||||
[JsonProperty("responseType")] public string ResponseType { get; set; } = "";
|
||||
|
||||
[JsonProperty("text")] public string Text { get; set; } = "";
|
||||
|
||||
[JsonProperty("giphyId")] public object GiphyId { get; set; } = new();
|
||||
|
||||
[JsonProperty("lockedText")] public bool? LockedText { get; set; }
|
||||
|
||||
[JsonProperty("isFree")] public bool? IsFree { get; set; }
|
||||
|
||||
[JsonProperty("price")] public string Price { get; set; } = "";
|
||||
|
||||
[JsonProperty("isMediaReady")] public bool? IsMediaReady { get; set; }
|
||||
|
||||
[JsonProperty("mediaCount")] public int? MediaCount { get; set; }
|
||||
|
||||
[JsonProperty("media")] public List<MediumDto> Media { get; set; } = [];
|
||||
|
||||
[JsonProperty("previews")] public List<object> Previews { get; set; } = [];
|
||||
|
||||
[JsonProperty("isTip")] public bool? IsTip { get; set; }
|
||||
|
||||
[JsonProperty("isReportedByMe")] public bool? IsReportedByMe { get; set; }
|
||||
|
||||
[JsonProperty("isCouplePeopleMedia")] public bool? IsCouplePeopleMedia { get; set; }
|
||||
|
||||
[JsonProperty("queueId")] public object QueueId { get; set; } = new();
|
||||
|
||||
[JsonProperty("fromUser")] public FromUserDto FromUser { get; set; } = new();
|
||||
|
||||
[JsonProperty("isFromQueue")] public bool? IsFromQueue { get; set; }
|
||||
|
||||
[JsonProperty("canUnsendQueue")] public bool? CanUnsendQueue { get; set; }
|
||||
|
||||
[JsonProperty("unsendSecondsQueue")] public int? UnsendSecondsQueue { get; set; }
|
||||
|
||||
[JsonProperty("id")] public long Id { get; set; }
|
||||
|
||||
[JsonProperty("isOpened")] public bool? IsOpened { get; set; }
|
||||
|
||||
[JsonProperty("isNew")] public bool? IsNew { get; set; }
|
||||
|
||||
[JsonProperty("createdAt")] public DateTime? CreatedAt { get; set; }
|
||||
|
||||
[JsonProperty("changedAt")] public DateTime? ChangedAt { get; set; }
|
||||
|
||||
[JsonProperty("cancelSeconds")] public int? CancelSeconds { get; set; }
|
||||
|
||||
[JsonProperty("isLiked")] public bool? IsLiked { get; set; }
|
||||
|
||||
[JsonProperty("canPurchase")] public bool? CanPurchase { get; set; }
|
||||
|
||||
[JsonProperty("canPurchaseReason")] public string CanPurchaseReason { get; set; } = "";
|
||||
|
||||
[JsonProperty("canReport")] public bool? CanReport { get; set; }
|
||||
|
||||
[JsonProperty("canBePinned")] public bool? CanBePinned { get; set; }
|
||||
|
||||
[JsonProperty("isPinned")] public bool? IsPinned { get; set; }
|
||||
}
|
||||
18
OF DL/Models/Dtos/Messages/ListsStateDto.cs
Normal file
18
OF DL/Models/Dtos/Messages/ListsStateDto.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Messages;
|
||||
|
||||
public class ListsStateDto
|
||||
{
|
||||
[JsonProperty("id")] public string Id { get; set; } = "";
|
||||
|
||||
[JsonProperty("type")] public string Type { get; set; } = "";
|
||||
|
||||
[JsonProperty("name")] public string Name { get; set; } = "";
|
||||
|
||||
[JsonProperty("hasUser")] public bool HasUser { get; set; }
|
||||
|
||||
[JsonProperty("canAddUser")] public bool CanAddUser { get; set; }
|
||||
|
||||
[JsonProperty("cannotAddUserReason")] public string CannotAddUserReason { get; set; } = "";
|
||||
}
|
||||
37
OF DL/Models/Dtos/Messages/MediumDto.cs
Normal file
37
OF DL/Models/Dtos/Messages/MediumDto.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using Newtonsoft.Json;
|
||||
using OF_DL.Models.Dtos.Common;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Messages;
|
||||
|
||||
public class MediumDto
|
||||
{
|
||||
[JsonProperty("id")] public long Id { get; set; }
|
||||
|
||||
[JsonProperty("canView")] public bool CanView { get; set; }
|
||||
|
||||
[JsonProperty("type")] public string Type { get; set; } = "";
|
||||
|
||||
[JsonProperty("src")] public string Src { get; set; } = "";
|
||||
|
||||
[JsonProperty("preview")] public string Preview { get; set; } = "";
|
||||
|
||||
[JsonProperty("thumb")] public string Thumb { get; set; } = "";
|
||||
|
||||
[JsonProperty("locked")] public object Locked { get; set; } = new();
|
||||
|
||||
[JsonProperty("duration")] public int? Duration { get; set; }
|
||||
|
||||
[JsonProperty("hasError")] public bool? HasError { get; set; }
|
||||
|
||||
[JsonProperty("squarePreview")] public string SquarePreview { get; set; } = "";
|
||||
|
||||
[JsonProperty("video")] public VideoDto Video { get; set; } = new();
|
||||
|
||||
[JsonProperty("videoSources")] public VideoSourcesDto VideoSources { get; set; } = new();
|
||||
|
||||
[JsonProperty("source")] public SourceDto Source { get; set; } = new();
|
||||
|
||||
[JsonProperty("info")] public InfoDto Info { get; set; } = new();
|
||||
|
||||
[JsonProperty("files")] public FilesDto Files { get; set; } = new();
|
||||
}
|
||||
10
OF DL/Models/Dtos/Messages/MessagesDto.cs
Normal file
10
OF DL/Models/Dtos/Messages/MessagesDto.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Messages;
|
||||
|
||||
public class MessagesDto
|
||||
{
|
||||
[JsonProperty("list")] public List<ListItemDto> List { get; set; } = [];
|
||||
|
||||
[JsonProperty("hasMore")] public bool HasMore { get; set; }
|
||||
}
|
||||
60
OF DL/Models/Dtos/Messages/SingleMessageDto.cs
Normal file
60
OF DL/Models/Dtos/Messages/SingleMessageDto.cs
Normal file
@ -0,0 +1,60 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OF_DL.Models.Dtos.Messages;
|
||||
|
||||
public class SingleMessageDto
|
||||
{
|
||||
[JsonProperty("responseType")] public string ResponseType { get; set; } = "";
|
||||
|
||||
[JsonProperty("text")] public string Text { get; set; } = "";
|
||||
|
||||
[JsonProperty("giphyId")] public object GiphyId { get; set; } = new();
|
||||
|
||||
[JsonProperty("lockedText")] public bool LockedText { get; set; }
|
||||
|
||||
[JsonProperty("isFree")] public bool IsFree { get; set; }
|
||||
|
||||
[JsonProperty("price")] public double Price { get; set; }
|
||||
|
||||
[JsonProperty("isMediaReady")] public bool IsMediaReady { get; set; }
|
||||
|
||||
[JsonProperty("mediaCount")] public int MediaCount { get; set; }
|
||||
|
||||
[JsonProperty("media")] public List<MediumDto> Media { get; set; } = [];
|
||||
|
||||
[JsonProperty("previews")] public List<object> Previews { get; set; } = [];
|
||||
|
||||
[JsonProperty("isTip")] public bool IsTip { get; set; }
|
||||
|
||||
[JsonProperty("isReportedByMe")] public bool IsReportedByMe { get; set; }
|
||||
|
||||
[JsonProperty("isCouplePeopleMedia")] public bool IsCouplePeopleMedia { get; set; }
|
||||
|
||||
[JsonProperty("queueId")] public long QueueId { get; set; }
|
||||
|
||||
[JsonProperty("fromUser")] public FromUserDto FromUser { get; set; } = new();
|
||||
|
||||
[JsonProperty("isFromQueue")] public bool IsFromQueue { get; set; }
|
||||
|
||||
[JsonProperty("canUnsendQueue")] public bool CanUnsendQueue { get; set; }
|
||||
|
||||
[JsonProperty("unsendSecondsQueue")] public int UnsendSecondsQueue { get; set; }
|
||||
|
||||
[JsonProperty("id")] public long Id { get; set; }
|
||||
|
||||
[JsonProperty("isOpened")] public bool IsOpened { get; set; }
|
||||
|
||||
[JsonProperty("isNew")] public bool IsNew { get; set; }
|
||||
|
||||
[JsonProperty("createdAt")] public DateTime? CreatedAt { get; set; }
|
||||
|
||||
[JsonProperty("changedAt")] public DateTime? ChangedAt { get; set; }
|
||||
|
||||
[JsonProperty("cancelSeconds")] public int CancelSeconds { get; set; }
|
||||
|
||||
[JsonProperty("isLiked")] public bool IsLiked { get; set; }
|
||||
|
||||
[JsonProperty("canPurchase")] public bool CanPurchase { get; set; }
|
||||
|
||||
[JsonProperty("canReport")] public bool CanReport { get; set; }
|
||||
}
|
||||
6
OF DL/Models/Entities/Common/FromUser.cs
Normal file
6
OF DL/Models/Entities/Common/FromUser.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace OF_DL.Models.Entities.Common;
|
||||
|
||||
public class FromUser
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
}
|
||||
22
OF DL/Models/Entities/Messages/ListItem.cs
Normal file
22
OF DL/Models/Entities/Messages/ListItem.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using OF_DL.Models.Entities.Common;
|
||||
|
||||
namespace OF_DL.Models.Entities.Messages;
|
||||
|
||||
public class ListItem
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public string? Text { get; set; }
|
||||
|
||||
public string? Price { get; set; }
|
||||
|
||||
public string? CanPurchaseReason { get; set; }
|
||||
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
|
||||
public List<object>? Previews { get; set; }
|
||||
|
||||
public List<Medium>? Media { get; set; }
|
||||
|
||||
public FromUser? FromUser { get; set; }
|
||||
}
|
||||
14
OF DL/Models/Entities/Messages/Medium.cs
Normal file
14
OF DL/Models/Entities/Messages/Medium.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using OF_DL.Models.Entities.Common;
|
||||
|
||||
namespace OF_DL.Models.Entities.Messages;
|
||||
|
||||
public class Medium
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public bool CanView { get; set; }
|
||||
|
||||
public string? Type { get; set; }
|
||||
|
||||
public Files? Files { get; set; }
|
||||
}
|
||||
10
OF DL/Models/Entities/Messages/MessageCollection.cs
Normal file
10
OF DL/Models/Entities/Messages/MessageCollection.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace OF_DL.Models.Entities.Messages;
|
||||
|
||||
public class MessageCollection
|
||||
{
|
||||
public List<Medium> MessageMedia { get; set; } = [];
|
||||
|
||||
public List<ListItem> MessageObjects { get; set; } = [];
|
||||
|
||||
public Dictionary<long, string> Messages { get; set; } = new();
|
||||
}
|
||||
8
OF DL/Models/Entities/Messages/Messages.cs
Normal file
8
OF DL/Models/Entities/Messages/Messages.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace OF_DL.Models.Entities.Messages;
|
||||
|
||||
public class Messages
|
||||
{
|
||||
public List<ListItem> List { get; set; } = [];
|
||||
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
20
OF DL/Models/Entities/Messages/SingleMessage.cs
Normal file
20
OF DL/Models/Entities/Messages/SingleMessage.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using OF_DL.Models.Entities.Common;
|
||||
|
||||
namespace OF_DL.Models.Entities.Messages;
|
||||
|
||||
public class SingleMessage
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public string? Text { get; set; }
|
||||
|
||||
public double? Price { get; set; }
|
||||
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
|
||||
public List<Medium>? Media { get; set; }
|
||||
|
||||
public List<object>? Previews { get; set; }
|
||||
|
||||
public FromUser? FromUser { get; set; }
|
||||
}
|
||||
110
OF DL/Models/Mappers/MessagesMapper.cs
Normal file
110
OF DL/Models/Mappers/MessagesMapper.cs
Normal file
@ -0,0 +1,110 @@
|
||||
using OF_DL.Models.Dtos.Common;
|
||||
using OF_DL.Models.Dtos.Messages;
|
||||
using OF_DL.Models.Entities.Common;
|
||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||
|
||||
namespace OF_DL.Models.Mappers;
|
||||
|
||||
public static class MessagesMapper
|
||||
{
|
||||
public static MessageEntities.Messages FromDto(MessagesDto? dto)
|
||||
{
|
||||
MessageEntities.Messages mapped = new() { HasMore = dto?.HasMore ?? false };
|
||||
|
||||
if (dto?.List == null)
|
||||
{
|
||||
return mapped;
|
||||
}
|
||||
|
||||
foreach (ListItemDto entry in dto.List)
|
||||
{
|
||||
mapped.List.Add(MapListItem(entry));
|
||||
}
|
||||
|
||||
return mapped;
|
||||
}
|
||||
|
||||
public static MessageEntities.SingleMessage FromDto(SingleMessageDto? dto)
|
||||
{
|
||||
MessageEntities.SingleMessage mapped = new();
|
||||
|
||||
if (dto == null)
|
||||
{
|
||||
return mapped;
|
||||
}
|
||||
|
||||
mapped.Id = dto.Id;
|
||||
mapped.Text = dto.Text;
|
||||
mapped.Price = dto.Price;
|
||||
mapped.CreatedAt = dto.CreatedAt;
|
||||
mapped.Media = MapMedia(dto.Media);
|
||||
mapped.Previews = dto.Previews;
|
||||
mapped.FromUser = MapFromUser(dto.FromUser);
|
||||
|
||||
return mapped;
|
||||
}
|
||||
|
||||
public static MessageEntities.Medium MapMedium(MediumDto dto) =>
|
||||
new() { Id = dto.Id, Type = dto.Type, CanView = dto.CanView, Files = MapFiles(dto.Files) };
|
||||
|
||||
private static MessageEntities.ListItem MapListItem(ListItemDto dto) =>
|
||||
new()
|
||||
{
|
||||
Id = dto.Id,
|
||||
Text = dto.Text,
|
||||
Price = dto.Price,
|
||||
CanPurchaseReason = dto.CanPurchaseReason,
|
||||
CreatedAt = dto.CreatedAt,
|
||||
Media = MapMedia(dto.Media),
|
||||
Previews = dto.Previews,
|
||||
FromUser = MapFromUser(dto.FromUser)
|
||||
};
|
||||
|
||||
private static List<MessageEntities.Medium>? MapMedia(List<MediumDto>? media) =>
|
||||
media?.Select(MapMedium).ToList();
|
||||
|
||||
private static FromUser? MapFromUser(FromUserDto? dto) =>
|
||||
dto == null ? null : new FromUser { Id = dto.Id };
|
||||
|
||||
private static Files? MapFiles(FilesDto? dto)
|
||||
{
|
||||
if (dto == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Files { Full = MapFull(dto.Full), Drm = MapDrm(dto.Drm) };
|
||||
}
|
||||
|
||||
private static Full? MapFull(FullDto? dto) => dto == null ? null : new Full { Url = dto.Url };
|
||||
|
||||
private static Drm? MapDrm(DrmDto? dto)
|
||||
{
|
||||
if (dto == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Drm { Manifest = MapManifest(dto.Manifest), Signature = MapSignature(dto.Signature) };
|
||||
}
|
||||
|
||||
private static Manifest? MapManifest(ManifestDto? dto) => dto == null ? null : new Manifest { Dash = dto.Dash };
|
||||
|
||||
private static Signature? MapSignature(SignatureDto? dto) =>
|
||||
dto == null ? null : new Signature { Dash = MapDash(dto.Dash) };
|
||||
|
||||
private static Dash? MapDash(DashDto? dto)
|
||||
{
|
||||
if (dto == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Dash
|
||||
{
|
||||
CloudFrontPolicy = dto.CloudFrontPolicy,
|
||||
CloudFrontSignature = dto.CloudFrontSignature,
|
||||
CloudFrontKeyPairId = dto.CloudFrontKeyPairId
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
namespace OF_DL.Models.Messages;
|
||||
|
||||
public class MessageCollection
|
||||
{
|
||||
public List<Messages.Medium> MessageMedia = new();
|
||||
public List<Messages.List> MessageObjects = new();
|
||||
public Dictionary<long, string> Messages = new();
|
||||
}
|
||||
@ -1,173 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace OF_DL.Models.Messages;
|
||||
|
||||
public class Messages
|
||||
{
|
||||
public List<List> list { get; set; }
|
||||
public bool hasMore { get; set; }
|
||||
|
||||
public class Dash
|
||||
{
|
||||
[JsonProperty("CloudFront-Policy")] public string CloudFrontPolicy { get; set; }
|
||||
|
||||
[JsonProperty("CloudFront-Signature")] public string CloudFrontSignature { get; set; }
|
||||
|
||||
[JsonProperty("CloudFront-Key-Pair-Id")]
|
||||
public string CloudFrontKeyPairId { get; set; }
|
||||
}
|
||||
|
||||
public class Drm
|
||||
{
|
||||
public Manifest manifest { get; set; }
|
||||
public Signature signature { get; set; }
|
||||
}
|
||||
|
||||
public class Files
|
||||
{
|
||||
public Full full { get; set; }
|
||||
public Thumb thumb { get; set; }
|
||||
public Preview preview { get; set; }
|
||||
public SquarePreview squarePreview { get; set; }
|
||||
public Drm drm { get; set; }
|
||||
}
|
||||
|
||||
public class Full
|
||||
{
|
||||
public string url { get; set; }
|
||||
public int width { get; set; }
|
||||
public int height { get; set; }
|
||||
public long size { get; set; }
|
||||
public List<object> sources { get; set; }
|
||||
}
|
||||
|
||||
public class SquarePreview
|
||||
{
|
||||
public string url { get; set; }
|
||||
public int width { get; set; }
|
||||
public int height { get; set; }
|
||||
public long size { get; set; }
|
||||
}
|
||||
|
||||
public class Thumb
|
||||
{
|
||||
public string url { get; set; }
|
||||
public int width { get; set; }
|
||||
public int height { get; set; }
|
||||
public long size { get; set; }
|
||||
}
|
||||
|
||||
public class FromUser
|
||||
{
|
||||
public long? id { get; set; }
|
||||
public string _view { get; set; }
|
||||
}
|
||||
|
||||
public class Hls
|
||||
{
|
||||
[JsonProperty("CloudFront-Policy")] public string CloudFrontPolicy { get; set; }
|
||||
|
||||
[JsonProperty("CloudFront-Signature")] public string CloudFrontSignature { get; set; }
|
||||
|
||||
[JsonProperty("CloudFront-Key-Pair-Id")]
|
||||
public string CloudFrontKeyPairId { get; set; }
|
||||
}
|
||||
|
||||
public class Info
|
||||
{
|
||||
public Source source { get; set; }
|
||||
public Preview preview { get; set; }
|
||||
}
|
||||
|
||||
public class List
|
||||
{
|
||||
public string responseType { get; set; }
|
||||
public string text { get; set; }
|
||||
public object giphyId { get; set; }
|
||||
public bool? lockedText { get; set; }
|
||||
public bool? isFree { get; set; }
|
||||
public string? price { get; set; }
|
||||
public bool? isMediaReady { get; set; }
|
||||
public int? mediaCount { get; set; }
|
||||
public List<Medium> media { get; set; }
|
||||
public List<object> previews { get; set; }
|
||||
public bool? isTip { get; set; }
|
||||
public bool? isReportedByMe { get; set; }
|
||||
public bool? isCouplePeopleMedia { get; set; }
|
||||
public object queueId { get; set; }
|
||||
public FromUser fromUser { get; set; }
|
||||
public bool? isFromQueue { get; set; }
|
||||
public bool? canUnsendQueue { get; set; }
|
||||
public int? unsendSecondsQueue { get; set; }
|
||||
public long id { get; set; }
|
||||
public bool? isOpened { get; set; }
|
||||
public bool? isNew { get; set; }
|
||||
public DateTime? createdAt { get; set; }
|
||||
public DateTime? changedAt { get; set; }
|
||||
public int? cancelSeconds { get; set; }
|
||||
public bool? isLiked { get; set; }
|
||||
public bool? canPurchase { get; set; }
|
||||
public string canPurchaseReason { get; set; }
|
||||
public bool? canReport { get; set; }
|
||||
public bool? canBePinned { get; set; }
|
||||
public bool? isPinned { get; set; }
|
||||
}
|
||||
|
||||
public class Manifest
|
||||
{
|
||||
public string hls { get; set; }
|
||||
public string dash { get; set; }
|
||||
}
|
||||
|
||||
public class Medium
|
||||
{
|
||||
public long id { get; set; }
|
||||
public bool canView { get; set; }
|
||||
public string type { get; set; }
|
||||
public string src { get; set; }
|
||||
public string preview { get; set; }
|
||||
public string thumb { get; set; }
|
||||
public object locked { get; set; }
|
||||
public int? duration { get; set; }
|
||||
public bool? hasError { get; set; }
|
||||
public string squarePreview { get; set; }
|
||||
public Video video { get; set; }
|
||||
public VideoSources videoSources { get; set; }
|
||||
public Source source { get; set; }
|
||||
public Info info { get; set; }
|
||||
public Files files { get; set; }
|
||||
}
|
||||
|
||||
public class Preview
|
||||
{
|
||||
public int? width { get; set; }
|
||||
public int? height { get; set; }
|
||||
public int? size { get; set; }
|
||||
}
|
||||
|
||||
public class Signature
|
||||
{
|
||||
public Hls hls { get; set; }
|
||||
public Dash dash { get; set; }
|
||||
}
|
||||
|
||||
public class Source
|
||||
{
|
||||
public string source { get; set; }
|
||||
public int? width { get; set; }
|
||||
public int? height { get; set; }
|
||||
public int? size { get; set; }
|
||||
}
|
||||
|
||||
public class Video
|
||||
{
|
||||
public string mp4 { get; set; }
|
||||
}
|
||||
|
||||
public class VideoSources
|
||||
{
|
||||
[JsonProperty("720")] public string _720 { get; set; }
|
||||
|
||||
[JsonProperty("240")] public string _240 { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,115 +0,0 @@
|
||||
using static OF_DL.Models.Messages.Messages;
|
||||
|
||||
namespace OF_DL.Models.Messages;
|
||||
|
||||
public class AvatarThumbs
|
||||
{
|
||||
public string c50 { get; set; }
|
||||
public string c144 { get; set; }
|
||||
}
|
||||
|
||||
public class FromUser
|
||||
{
|
||||
public string view { get; set; }
|
||||
public string avatar { get; set; }
|
||||
public AvatarThumbs avatarThumbs { get; set; }
|
||||
public string header { get; set; }
|
||||
public HeaderSize headerSize { get; set; }
|
||||
public HeaderThumbs headerThumbs { get; set; }
|
||||
public long? id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string username { get; set; }
|
||||
public bool canLookStory { get; set; }
|
||||
public bool canCommentStory { get; set; }
|
||||
public bool hasNotViewedStory { get; set; }
|
||||
public bool isVerified { get; set; }
|
||||
public bool canPayInternal { get; set; }
|
||||
public bool hasScheduledStream { get; set; }
|
||||
public bool hasStream { get; set; }
|
||||
public bool hasStories { get; set; }
|
||||
public bool tipsEnabled { get; set; }
|
||||
public bool tipsTextEnabled { get; set; }
|
||||
public int tipsMin { get; set; }
|
||||
public int tipsMinInternal { get; set; }
|
||||
public int tipsMax { get; set; }
|
||||
public bool canEarn { get; set; }
|
||||
public bool canAddSubscriber { get; set; }
|
||||
public string? subscribePrice { get; set; }
|
||||
public List<object> subscriptionBundles { get; set; }
|
||||
public bool isPaywallRequired { get; set; }
|
||||
public List<ListsState> listsStates { get; set; }
|
||||
public bool isRestricted { get; set; }
|
||||
public bool canRestrict { get; set; }
|
||||
public object subscribedBy { get; set; }
|
||||
public object subscribedByExpire { get; set; }
|
||||
public DateTime subscribedByExpireDate { get; set; }
|
||||
public object subscribedByAutoprolong { get; set; }
|
||||
public bool subscribedIsExpiredNow { get; set; }
|
||||
public object currentSubscribePrice { get; set; }
|
||||
public object subscribedOn { get; set; }
|
||||
public object subscribedOnExpiredNow { get; set; }
|
||||
public object subscribedOnDuration { get; set; }
|
||||
public int callPrice { get; set; }
|
||||
public DateTime? lastSeen { get; set; }
|
||||
public bool canReport { get; set; }
|
||||
}
|
||||
|
||||
public class HeaderSize
|
||||
{
|
||||
public int width { get; set; }
|
||||
public int height { get; set; }
|
||||
}
|
||||
|
||||
public class HeaderThumbs
|
||||
{
|
||||
public string w480 { get; set; }
|
||||
public string w760 { get; set; }
|
||||
}
|
||||
|
||||
public class ListsState
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string type { get; set; }
|
||||
public string name { get; set; }
|
||||
public bool hasUser { get; set; }
|
||||
public bool canAddUser { get; set; }
|
||||
public string cannotAddUserReason { get; set; }
|
||||
}
|
||||
|
||||
public class Preview
|
||||
{
|
||||
public int width { get; set; }
|
||||
public int height { get; set; }
|
||||
public long size { get; set; }
|
||||
}
|
||||
|
||||
public class SingleMessage
|
||||
{
|
||||
public string responseType { get; set; }
|
||||
public string text { get; set; }
|
||||
public object giphyId { get; set; }
|
||||
public bool lockedText { get; set; }
|
||||
public bool isFree { get; set; }
|
||||
public double price { get; set; }
|
||||
public bool isMediaReady { get; set; }
|
||||
public int mediaCount { get; set; }
|
||||
public List<Medium> media { get; set; }
|
||||
public List<object> previews { get; set; }
|
||||
public bool isTip { get; set; }
|
||||
public bool isReportedByMe { get; set; }
|
||||
public bool isCouplePeopleMedia { get; set; }
|
||||
public long queueId { get; set; }
|
||||
public FromUser fromUser { get; set; }
|
||||
public bool isFromQueue { get; set; }
|
||||
public bool canUnsendQueue { get; set; }
|
||||
public int unsendSecondsQueue { get; set; }
|
||||
public long id { get; set; }
|
||||
public bool isOpened { get; set; }
|
||||
public bool isNew { get; set; }
|
||||
public DateTime? createdAt { get; set; }
|
||||
public DateTime? changedAt { get; set; }
|
||||
public int cancelSeconds { get; set; }
|
||||
public bool isLiked { get; set; }
|
||||
public bool canPurchase { get; set; }
|
||||
public bool canReport { get; set; }
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
using static OF_DL.Models.Messages.Messages;
|
||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||
|
||||
namespace OF_DL.Models.Purchased;
|
||||
|
||||
public class PaidMessageCollection
|
||||
{
|
||||
public List<Medium> PaidMessageMedia = new();
|
||||
public List<MessageEntities.Medium> PaidMessageMedia = new();
|
||||
public List<Purchased.List> PaidMessageObjects = new();
|
||||
public Dictionary<long, string> PaidMessages = new();
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
using static OF_DL.Models.Messages.Messages;
|
||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||
|
||||
namespace OF_DL.Models.Purchased;
|
||||
|
||||
public class PaidPostCollection
|
||||
{
|
||||
public List<Medium> PaidPostMedia = new();
|
||||
public List<MessageEntities.Medium> PaidPostMedia = new();
|
||||
public List<Purchased.List> PaidPostObjects = new();
|
||||
public Dictionary<long, string> PaidPosts = new();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using static OF_DL.Models.Messages.Messages;
|
||||
using OF_DL.Models.Dtos.Messages;
|
||||
|
||||
namespace OF_DL.Models.Purchased;
|
||||
|
||||
@ -41,7 +41,7 @@ public class Purchased
|
||||
public string? price { get; set; }
|
||||
public bool? isMediaReady { get; set; }
|
||||
public int? mediaCount { get; set; }
|
||||
public List<Medium> media { get; set; }
|
||||
public List<MediumDto> media { get; set; }
|
||||
public List<object> previews { get; set; }
|
||||
public List<object> preview { get; set; }
|
||||
public bool? isTip { get; set; }
|
||||
|
||||
@ -1,14 +1,13 @@
|
||||
using OF_DL.Models.Messages;
|
||||
using static OF_DL.Models.Messages.Messages;
|
||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||
|
||||
namespace OF_DL.Models.Purchased;
|
||||
|
||||
public class SinglePaidMessageCollection
|
||||
{
|
||||
public List<Medium> PreviewSingleMessageMedia = new();
|
||||
public List<MessageEntities.Medium> PreviewSingleMessageMedia = new();
|
||||
|
||||
public Dictionary<long, string> PreviewSingleMessages = new();
|
||||
public List<Medium> SingleMessageMedia = new();
|
||||
public List<SingleMessage> SingleMessageObjects = new();
|
||||
public List<MessageEntities.Medium> SingleMessageMedia = new();
|
||||
public List<MessageEntities.SingleMessage> SingleMessageObjects = new();
|
||||
public Dictionary<long, string> SingleMessages = new();
|
||||
}
|
||||
|
||||
@ -7,13 +7,13 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OF_DL.CLI;
|
||||
using OF_DL.Models;
|
||||
using OF_DL.Models.Messages;
|
||||
using OF_DL.Models.Post;
|
||||
using OF_DL.Models.Purchased;
|
||||
using OF_DL.Models.Streams;
|
||||
using OF_DL.Enumerations;
|
||||
using OF_DL.Helpers;
|
||||
using ArchivedModels = OF_DL.Models.Entities.Archived;
|
||||
using ArchivedEntities = OF_DL.Models.Entities.Archived;
|
||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||
using OF_DL.Services;
|
||||
using Serilog;
|
||||
using Spectre.Console;
|
||||
@ -1116,7 +1116,7 @@ public class Program(IServiceProvider serviceProvider)
|
||||
IAPIService apiService = serviceProvider.GetRequiredService<IAPIService>();
|
||||
IDownloadService downloadService = serviceProvider.GetRequiredService<IDownloadService>();
|
||||
|
||||
MessageCollection messages = new();
|
||||
MessageEntities.MessageCollection messages = new();
|
||||
|
||||
await AnsiConsole.Status()
|
||||
.StartAsync("[red]Getting Messages[/]",
|
||||
@ -1274,7 +1274,7 @@ public class Program(IServiceProvider serviceProvider)
|
||||
IAPIService apiService = serviceProvider.GetRequiredService<IAPIService>();
|
||||
IDownloadService downloadService = serviceProvider.GetRequiredService<IDownloadService>();
|
||||
|
||||
ArchivedModels.ArchivedCollection archived = new();
|
||||
ArchivedEntities.ArchivedCollection archived = new();
|
||||
|
||||
await AnsiConsole.Status()
|
||||
.StartAsync("[red]Getting Archived Posts[/]",
|
||||
@ -1523,11 +1523,11 @@ public class Program(IServiceProvider serviceProvider)
|
||||
pssh);
|
||||
}
|
||||
|
||||
Messages.Medium? mediaInfo =
|
||||
purchasedPosts?.PaidPostMedia?.FirstOrDefault(m => m.id == purchasedPostKVP.Key);
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
purchasedPosts?.PaidPostMedia?.FirstOrDefault(m => m.Id == purchasedPostKVP.Key);
|
||||
Purchased.List? postInfo = mediaInfo != null
|
||||
? purchasedPosts?.PaidPostObjects?.FirstOrDefault(p =>
|
||||
p?.media?.Contains(mediaInfo) == true)
|
||||
p?.media?.Any(m => m.Id == purchasedPostKVP.Key) == true)
|
||||
: null;
|
||||
|
||||
isNew = await downloadService.DownloadPurchasedPostDRMVideo(
|
||||
@ -1558,11 +1558,11 @@ public class Program(IServiceProvider serviceProvider)
|
||||
}
|
||||
else
|
||||
{
|
||||
Messages.Medium? mediaInfo =
|
||||
purchasedPosts?.PaidPostMedia?.FirstOrDefault(m => m.id == purchasedPostKVP.Key);
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
purchasedPosts?.PaidPostMedia?.FirstOrDefault(m => m.Id == purchasedPostKVP.Key);
|
||||
Purchased.List? postInfo = mediaInfo != null
|
||||
? purchasedPosts?.PaidPostObjects?.FirstOrDefault(p =>
|
||||
p?.media?.Contains(mediaInfo) == true)
|
||||
p?.media?.Any(m => m.Id == purchasedPostKVP.Key) == true)
|
||||
: null;
|
||||
|
||||
isNew = await downloadService.DownloadPurchasedPostMedia(
|
||||
@ -1672,12 +1672,12 @@ public class Program(IServiceProvider serviceProvider)
|
||||
pssh);
|
||||
}
|
||||
|
||||
Messages.Medium? mediaInfo =
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
paidMessageCollection.PaidMessageMedia.FirstOrDefault(m =>
|
||||
m.id == paidMessageKVP.Key);
|
||||
m.Id == paidMessageKVP.Key);
|
||||
Purchased.List? messageInfo =
|
||||
paidMessageCollection.PaidMessageObjects.FirstOrDefault(p =>
|
||||
p?.media?.Contains(mediaInfo) == true);
|
||||
p?.media?.Any(m => m.Id == paidMessageKVP.Key) == true);
|
||||
|
||||
isNew = await downloadService.DownloadPurchasedMessageDRMVideo(
|
||||
policy,
|
||||
@ -1709,11 +1709,11 @@ public class Program(IServiceProvider serviceProvider)
|
||||
}
|
||||
else
|
||||
{
|
||||
Messages.Medium? mediaInfo =
|
||||
paidMessageCollection.PaidMessageMedia.FirstOrDefault(m => m.id == paidMessageKVP.Key);
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
paidMessageCollection.PaidMessageMedia.FirstOrDefault(m => m.Id == paidMessageKVP.Key);
|
||||
Purchased.List messageInfo =
|
||||
paidMessageCollection.PaidMessageObjects.FirstOrDefault(p =>
|
||||
p?.media?.Contains(mediaInfo) == true);
|
||||
p?.media?.Any(m => m.Id == paidMessageKVP.Key) == true);
|
||||
|
||||
isNew = await downloadService.DownloadPurchasedMedia(
|
||||
paidMessageKVP.Value,
|
||||
@ -1899,12 +1899,12 @@ public class Program(IServiceProvider serviceProvider)
|
||||
pssh);
|
||||
}
|
||||
|
||||
Messages.Medium? mediaInfo =
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
singlePaidMessageCollection.PreviewSingleMessageMedia.FirstOrDefault(m =>
|
||||
m.id == paidMessageKVP.Key);
|
||||
SingleMessage? messageInfo =
|
||||
m.Id == paidMessageKVP.Key);
|
||||
MessageEntities.SingleMessage? messageInfo =
|
||||
singlePaidMessageCollection.SingleMessageObjects.FirstOrDefault(p =>
|
||||
p?.media?.Contains(mediaInfo) == true);
|
||||
p?.Media?.Any(m => m.Id == paidMessageKVP.Key) == true);
|
||||
|
||||
isNew = await downloadService.DownloadSingleMessagePreviewDRMVideo(
|
||||
policy,
|
||||
@ -1921,7 +1921,7 @@ public class Program(IServiceProvider serviceProvider)
|
||||
.PaidMessageFileNameFormat ?? string.Empty,
|
||||
messageInfo,
|
||||
mediaInfo,
|
||||
messageInfo?.fromUser,
|
||||
messageInfo?.FromUser,
|
||||
hasSelectedUsersKVP.Value);
|
||||
|
||||
if (isNew)
|
||||
@ -1936,12 +1936,12 @@ public class Program(IServiceProvider serviceProvider)
|
||||
}
|
||||
else
|
||||
{
|
||||
Messages.Medium? mediaInfo =
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
singlePaidMessageCollection.PreviewSingleMessageMedia.FirstOrDefault(m =>
|
||||
m.id == paidMessageKVP.Key);
|
||||
SingleMessage? messageInfo =
|
||||
m.Id == paidMessageKVP.Key);
|
||||
MessageEntities.SingleMessage? messageInfo =
|
||||
singlePaidMessageCollection.SingleMessageObjects.FirstOrDefault(p =>
|
||||
p?.media?.Contains(mediaInfo) == true);
|
||||
p?.Media?.Any(m => m.Id == paidMessageKVP.Key) == true);
|
||||
|
||||
isNew = await downloadService.DownloadMessagePreviewMedia(
|
||||
paidMessageKVP.Value,
|
||||
@ -1953,7 +1953,7 @@ public class Program(IServiceProvider serviceProvider)
|
||||
.PaidMessageFileNameFormat ?? string.Empty,
|
||||
messageInfo,
|
||||
mediaInfo,
|
||||
messageInfo?.fromUser,
|
||||
messageInfo?.FromUser,
|
||||
hasSelectedUsersKVP.Value);
|
||||
if (isNew)
|
||||
{
|
||||
@ -2039,12 +2039,12 @@ public class Program(IServiceProvider serviceProvider)
|
||||
pssh);
|
||||
}
|
||||
|
||||
Messages.Medium? mediaInfo =
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
singlePaidMessageCollection.SingleMessageMedia.FirstOrDefault(m =>
|
||||
m.id == paidMessageKVP.Key);
|
||||
SingleMessage? messageInfo =
|
||||
m.Id == paidMessageKVP.Key);
|
||||
MessageEntities.SingleMessage? messageInfo =
|
||||
singlePaidMessageCollection.SingleMessageObjects.FirstOrDefault(p =>
|
||||
p?.media?.Contains(mediaInfo) == true);
|
||||
p?.Media?.Any(m => m.Id == paidMessageKVP.Key) == true);
|
||||
|
||||
isNew = await downloadService.DownloadSinglePurchasedMessageDRMVideo(
|
||||
policy,
|
||||
@ -2061,7 +2061,7 @@ public class Program(IServiceProvider serviceProvider)
|
||||
.PaidMessageFileNameFormat ?? string.Empty,
|
||||
messageInfo,
|
||||
mediaInfo,
|
||||
messageInfo?.fromUser,
|
||||
messageInfo?.FromUser,
|
||||
hasSelectedUsersKVP.Value);
|
||||
|
||||
if (isNew)
|
||||
@ -2076,12 +2076,12 @@ public class Program(IServiceProvider serviceProvider)
|
||||
}
|
||||
else
|
||||
{
|
||||
Messages.Medium? mediaInfo =
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
singlePaidMessageCollection.SingleMessageMedia.FirstOrDefault(m =>
|
||||
m.id == paidMessageKVP.Key);
|
||||
SingleMessage? messageInfo =
|
||||
m.Id == paidMessageKVP.Key);
|
||||
MessageEntities.SingleMessage? messageInfo =
|
||||
singlePaidMessageCollection.SingleMessageObjects.FirstOrDefault(p =>
|
||||
p?.media?.Contains(mediaInfo) == true);
|
||||
p?.Media?.Any(m => m.Id == paidMessageKVP.Key) == true);
|
||||
|
||||
isNew = await downloadService.DownloadSinglePurchasedMedia(
|
||||
paidMessageKVP.Value,
|
||||
@ -2093,7 +2093,7 @@ public class Program(IServiceProvider serviceProvider)
|
||||
.PaidMessageFileNameFormat ?? string.Empty,
|
||||
messageInfo,
|
||||
mediaInfo,
|
||||
messageInfo?.fromUser,
|
||||
messageInfo?.FromUser,
|
||||
hasSelectedUsersKVP.Value);
|
||||
if (isNew)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -4,17 +4,16 @@ using System.Xml.Linq;
|
||||
using FFmpeg.NET;
|
||||
using FFmpeg.NET.Events;
|
||||
using OF_DL.Models;
|
||||
using OF_DL.Models.Messages;
|
||||
using OF_DL.Models.Post;
|
||||
using OF_DL.Models.Purchased;
|
||||
using OF_DL.Models.Streams;
|
||||
using OF_DL.Enumerations;
|
||||
using ArchivedModels = OF_DL.Models.Entities.Archived;
|
||||
using OF_DL.Models.Entities.Common;
|
||||
using ArchivedEntities = OF_DL.Models.Entities.Archived;
|
||||
using OF_DL.Utils;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
using static OF_DL.Models.Messages.Messages;
|
||||
using FromUser = OF_DL.Models.Messages.FromUser;
|
||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||
|
||||
namespace OF_DL.Services;
|
||||
|
||||
@ -1036,14 +1035,14 @@ public class DownloadService(
|
||||
|
||||
|
||||
public async Task<bool> DownloadMessageMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, List? messageInfo, Medium? messageMedia,
|
||||
Messages.FromUser? fromUser, Dictionary<string, long> users)
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.ListItem? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users)
|
||||
{
|
||||
string path;
|
||||
if (configService.CurrentConfig.FolderPerMessage && messageInfo != null && messageInfo?.id is not null &&
|
||||
messageInfo?.createdAt is not null)
|
||||
if (configService.CurrentConfig.FolderPerMessage && messageInfo != null && messageInfo?.Id is not null &&
|
||||
messageInfo?.CreatedAt is not null)
|
||||
{
|
||||
path = $"/Messages/Free/{messageInfo.id} {messageInfo.createdAt.Value:yyyy-MM-dd HH-mm-ss}";
|
||||
path = $"/Messages/Free/{messageInfo.Id} {messageInfo.CreatedAt.Value:yyyy-MM-dd HH-mm-ss}";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1059,15 +1058,14 @@ public class DownloadService(
|
||||
}
|
||||
|
||||
public async Task<bool> DownloadMessagePreviewMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, SingleMessage? messageInfo,
|
||||
Medium? messageMedia,
|
||||
FromUser? fromUser, Dictionary<string, long> users)
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.SingleMessage? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users)
|
||||
{
|
||||
string path;
|
||||
if (configService.CurrentConfig.FolderPerMessage && messageInfo != null && messageInfo?.id is not null &&
|
||||
messageInfo?.createdAt is not null)
|
||||
if (configService.CurrentConfig.FolderPerMessage && messageInfo != null && messageInfo?.Id is not null &&
|
||||
messageInfo?.CreatedAt is not null)
|
||||
{
|
||||
path = $"/Messages/Free/{messageInfo.id} {messageInfo.createdAt.Value:yyyy-MM-dd HH-mm-ss}";
|
||||
path = $"/Messages/Free/{messageInfo.Id} {messageInfo.CreatedAt.Value:yyyy-MM-dd HH-mm-ss}";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1084,8 +1082,8 @@ public class DownloadService(
|
||||
|
||||
|
||||
public async Task<bool> DownloadArchivedMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, ArchivedModels.ListItem? messageInfo,
|
||||
ArchivedModels.Medium? messageMedia, Models.Entities.Common.Author? author,
|
||||
IProgressReporter progressReporter, string? filenameFormat, ArchivedEntities.ListItem? messageInfo,
|
||||
ArchivedEntities.Medium? messageMedia, Author? author,
|
||||
Dictionary<string, long> users)
|
||||
{
|
||||
string path = "/Archived/Posts/Free";
|
||||
@ -1110,7 +1108,7 @@ public class DownloadService(
|
||||
|
||||
public async Task<bool> DownloadPurchasedMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, Purchased.List? messageInfo,
|
||||
Medium? messageMedia,
|
||||
MessageEntities.Medium? messageMedia,
|
||||
Purchased.FromUser? fromUser, Dictionary<string, long> users)
|
||||
{
|
||||
string path;
|
||||
@ -1133,15 +1131,14 @@ public class DownloadService(
|
||||
}
|
||||
|
||||
public async Task<bool> DownloadSinglePurchasedMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, SingleMessage? messageInfo,
|
||||
Medium? messageMedia,
|
||||
FromUser? fromUser, Dictionary<string, long> users)
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.SingleMessage? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users)
|
||||
{
|
||||
string path;
|
||||
if (configService.CurrentConfig.FolderPerPaidMessage && messageInfo != null && messageInfo?.id is not null &&
|
||||
messageInfo?.createdAt is not null)
|
||||
if (configService.CurrentConfig.FolderPerPaidMessage && messageInfo != null && messageInfo?.Id is not null &&
|
||||
messageInfo?.CreatedAt is not null)
|
||||
{
|
||||
path = $"/Messages/Paid/{messageInfo.id} {messageInfo.createdAt.Value:yyyy-MM-dd HH-mm-ss}";
|
||||
path = $"/Messages/Paid/{messageInfo.Id} {messageInfo.CreatedAt.Value:yyyy-MM-dd HH-mm-ss}";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1163,7 +1160,7 @@ public class DownloadService(
|
||||
IProgressReporter progressReporter,
|
||||
string? filenameFormat,
|
||||
Purchased.List? messageInfo,
|
||||
Medium? messageMedia,
|
||||
MessageEntities.Medium? messageMedia,
|
||||
Purchased.FromUser? fromUser,
|
||||
Dictionary<string, long> users)
|
||||
{
|
||||
@ -1193,8 +1190,8 @@ public class DownloadService(
|
||||
|
||||
public async Task<bool> DownloadMessageDRMVideo(string policy, string signature, string kvp, string url,
|
||||
string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, List? messageInfo, Medium? messageMedia,
|
||||
Messages.FromUser? fromUser, Dictionary<string, long> users)
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.ListItem? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1202,10 +1199,10 @@ public class DownloadService(
|
||||
string path;
|
||||
Uri uri = new(url);
|
||||
string filename = Path.GetFileName(uri.LocalPath).Split(".")[0];
|
||||
if (configService.CurrentConfig.FolderPerMessage && messageInfo != null && messageInfo?.id is not null &&
|
||||
messageInfo?.createdAt is not null)
|
||||
if (configService.CurrentConfig.FolderPerMessage && messageInfo != null && messageInfo?.Id is not null &&
|
||||
messageInfo?.CreatedAt is not null)
|
||||
{
|
||||
path = $"/Messages/Free/{messageInfo.id} {messageInfo.createdAt.Value:yyyy-MM-dd HH-mm-ss}/Videos";
|
||||
path = $"/Messages/Free/{messageInfo.Id} {messageInfo.CreatedAt.Value:yyyy-MM-dd HH-mm-ss}/Videos";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1322,9 +1319,8 @@ public class DownloadService(
|
||||
|
||||
public async Task<bool> DownloadSingleMessagePreviewDRMVideo(string policy, string signature, string kvp,
|
||||
string url, string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, SingleMessage? messageInfo,
|
||||
Medium? messageMedia,
|
||||
FromUser? fromUser, Dictionary<string, long> users)
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.SingleMessage? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1332,10 +1328,10 @@ public class DownloadService(
|
||||
string path;
|
||||
Uri uri = new(url);
|
||||
string filename = Path.GetFileName(uri.LocalPath).Split(".")[0];
|
||||
if (configService.CurrentConfig.FolderPerMessage && messageInfo != null && messageInfo?.id is not null &&
|
||||
messageInfo?.createdAt is not null)
|
||||
if (configService.CurrentConfig.FolderPerMessage && messageInfo != null && messageInfo?.Id is not null &&
|
||||
messageInfo?.CreatedAt is not null)
|
||||
{
|
||||
path = $"/Messages/Free/{messageInfo.id} {messageInfo.createdAt.Value:yyyy-MM-dd HH-mm-ss}/Videos";
|
||||
path = $"/Messages/Free/{messageInfo.Id} {messageInfo.CreatedAt.Value:yyyy-MM-dd HH-mm-ss}/Videos";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1454,7 +1450,7 @@ public class DownloadService(
|
||||
public async Task<bool> DownloadPurchasedMessageDRMVideo(string policy, string signature, string kvp, string url,
|
||||
string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, Purchased.List? messageInfo,
|
||||
Medium? messageMedia,
|
||||
MessageEntities.Medium? messageMedia,
|
||||
Purchased.FromUser? fromUser, Dictionary<string, long> users)
|
||||
{
|
||||
try
|
||||
@ -1582,9 +1578,8 @@ public class DownloadService(
|
||||
|
||||
public async Task<bool> DownloadSinglePurchasedMessageDRMVideo(string policy, string signature, string kvp,
|
||||
string url, string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, SingleMessage? messageInfo,
|
||||
Medium? messageMedia,
|
||||
FromUser? fromUser, Dictionary<string, long> users)
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.SingleMessage? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1593,9 +1588,9 @@ public class DownloadService(
|
||||
Uri uri = new(url);
|
||||
string filename = Path.GetFileName(uri.LocalPath).Split(".")[0];
|
||||
if (configService.CurrentConfig.FolderPerPaidMessage && messageInfo != null &&
|
||||
messageInfo?.id is not null && messageInfo?.createdAt is not null)
|
||||
messageInfo?.Id is not null && messageInfo?.CreatedAt is not null)
|
||||
{
|
||||
path = $"/Messages/Paid/{messageInfo.id} {messageInfo.createdAt.Value:yyyy-MM-dd HH-mm-ss}/Videos";
|
||||
path = $"/Messages/Paid/{messageInfo.Id} {messageInfo.CreatedAt.Value:yyyy-MM-dd HH-mm-ss}/Videos";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2097,7 +2092,7 @@ public class DownloadService(
|
||||
public async Task<bool> DownloadPurchasedPostDRMVideo(string policy, string signature, string kvp, string url,
|
||||
string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, Purchased.List? postInfo,
|
||||
Medium? postMedia,
|
||||
MessageEntities.Medium? postMedia,
|
||||
Purchased.FromUser? fromUser, Dictionary<string, long> users)
|
||||
{
|
||||
try
|
||||
@ -2227,9 +2222,9 @@ public class DownloadService(
|
||||
|
||||
public async Task<bool> DownloadArchivedPostDRMVideo(string policy, string signature, string kvp, string url,
|
||||
string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, ArchivedModels.ListItem? postInfo,
|
||||
ArchivedModels.Medium? postMedia,
|
||||
Models.Entities.Common.Author? author, Dictionary<string, long> users)
|
||||
IProgressReporter progressReporter, string? filenameFormat, ArchivedEntities.ListItem? postInfo,
|
||||
ArchivedEntities.Medium? postMedia,
|
||||
Author? author, Dictionary<string, long> users)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -2454,7 +2449,7 @@ public class DownloadService(
|
||||
|
||||
public async Task<DownloadResult> DownloadArchived(string username, long userId, string path,
|
||||
Dictionary<string, long> users, bool clientIdBlobMissing, bool devicePrivateKeyMissing,
|
||||
ArchivedModels.ArchivedCollection archived, IProgressReporter progressReporter)
|
||||
ArchivedEntities.ArchivedCollection archived, IProgressReporter progressReporter)
|
||||
{
|
||||
Log.Debug($"Calling DownloadArchived - {username}");
|
||||
|
||||
@ -2511,9 +2506,9 @@ public class DownloadService(
|
||||
pssh);
|
||||
}
|
||||
|
||||
ArchivedModels.Medium? mediaInfo =
|
||||
ArchivedEntities.Medium? mediaInfo =
|
||||
archived.ArchivedPostMedia.FirstOrDefault(m => m.Id == archivedKVP.Key);
|
||||
ArchivedModels.ListItem? postInfo =
|
||||
ArchivedEntities.ListItem? postInfo =
|
||||
archived.ArchivedPostObjects.FirstOrDefault(p => p?.Media?.Contains(mediaInfo) == true);
|
||||
|
||||
isNew = await DownloadArchivedPostDRMVideo(
|
||||
@ -2541,9 +2536,9 @@ public class DownloadService(
|
||||
}
|
||||
else
|
||||
{
|
||||
ArchivedModels.Medium? mediaInfo =
|
||||
ArchivedEntities.Medium? mediaInfo =
|
||||
archived.ArchivedPostMedia.FirstOrDefault(m => m.Id == archivedKVP.Key);
|
||||
ArchivedModels.ListItem? postInfo =
|
||||
ArchivedEntities.ListItem? postInfo =
|
||||
archived.ArchivedPostObjects.FirstOrDefault(p => p?.Media?.Contains(mediaInfo) == true);
|
||||
|
||||
isNew = await DownloadArchivedMedia(
|
||||
@ -2585,7 +2580,7 @@ public class DownloadService(
|
||||
|
||||
public async Task<DownloadResult> DownloadMessages(string username, long userId, string path,
|
||||
Dictionary<string, long> users, bool clientIdBlobMissing, bool devicePrivateKeyMissing,
|
||||
MessageCollection messages, IProgressReporter progressReporter)
|
||||
MessageEntities.MessageCollection messages, IProgressReporter progressReporter)
|
||||
{
|
||||
Log.Debug($"Calling DownloadMessages - {username}");
|
||||
|
||||
@ -2641,9 +2636,10 @@ public class DownloadService(
|
||||
pssh);
|
||||
}
|
||||
|
||||
Medium? mediaInfo = messages.MessageMedia.FirstOrDefault(m => m.id == messageKVP.Key);
|
||||
List? messageInfo =
|
||||
messages.MessageObjects.FirstOrDefault(p => p?.media?.Contains(mediaInfo) == true);
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
messages.MessageMedia.FirstOrDefault(m => m.Id == messageKVP.Key);
|
||||
MessageEntities.ListItem? messageInfo = messages.MessageObjects.FirstOrDefault(p =>
|
||||
p?.Media?.Any(m => m.Id == messageKVP.Key) == true);
|
||||
|
||||
isNew = await DownloadMessageDRMVideo(
|
||||
policy,
|
||||
@ -2660,7 +2656,7 @@ public class DownloadService(
|
||||
string.Empty,
|
||||
messageInfo,
|
||||
mediaInfo,
|
||||
messageInfo?.fromUser,
|
||||
messageInfo?.FromUser,
|
||||
users);
|
||||
}
|
||||
else
|
||||
@ -2670,8 +2666,9 @@ public class DownloadService(
|
||||
}
|
||||
else
|
||||
{
|
||||
Medium? mediaInfo = messages.MessageMedia.FirstOrDefault(m => m.id == messageKVP.Key);
|
||||
List? messageInfo = messages.MessageObjects.FirstOrDefault(p => p?.media?.Contains(mediaInfo) == true);
|
||||
MessageEntities.Medium? mediaInfo = messages.MessageMedia.FirstOrDefault(m => m.Id == messageKVP.Key);
|
||||
MessageEntities.ListItem? messageInfo = messages.MessageObjects.FirstOrDefault(p =>
|
||||
p?.Media?.Any(m => m.Id == messageKVP.Key) == true);
|
||||
|
||||
isNew = await DownloadMessageMedia(
|
||||
messageKVP.Value,
|
||||
@ -2683,7 +2680,7 @@ public class DownloadService(
|
||||
string.Empty,
|
||||
messageInfo,
|
||||
mediaInfo,
|
||||
messageInfo?.fromUser,
|
||||
messageInfo?.FromUser,
|
||||
users);
|
||||
}
|
||||
|
||||
@ -2757,11 +2754,11 @@ public class DownloadService(
|
||||
$"https://onlyfans.com/api2/v2/users/media/{parsed[4]}/drm/message/{parsed[5]}?type=widevine",
|
||||
pssh);
|
||||
|
||||
Medium? mediaInfo =
|
||||
paidMessageCollection.PaidMessageMedia.FirstOrDefault(m => m.id == kvp.Key);
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
paidMessageCollection.PaidMessageMedia.FirstOrDefault(m => m.Id == kvp.Key);
|
||||
Purchased.List? messageInfo =
|
||||
paidMessageCollection.PaidMessageObjects.FirstOrDefault(p =>
|
||||
p?.media?.Contains(mediaInfo) == true);
|
||||
p?.media?.Any(m => m.Id == kvp.Key) == true);
|
||||
|
||||
isNew = await DownloadPurchasedMessageDRMVideo(parsed[1], parsed[2], parsed[3], parsed[0],
|
||||
decryptionKey, path, lastModified, kvp.Key, "Messages", progressReporter,
|
||||
@ -2775,10 +2772,10 @@ public class DownloadService(
|
||||
}
|
||||
else
|
||||
{
|
||||
Medium? mediaInfo =
|
||||
paidMessageCollection.PaidMessageMedia.FirstOrDefault(m => m.id == kvp.Key);
|
||||
Purchased.List? messageInfo =
|
||||
paidMessageCollection.PaidMessageObjects.FirstOrDefault(p => p?.media?.Contains(mediaInfo) == true);
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
paidMessageCollection.PaidMessageMedia.FirstOrDefault(m => m.Id == kvp.Key);
|
||||
Purchased.List? messageInfo = paidMessageCollection.PaidMessageObjects.FirstOrDefault(p =>
|
||||
p?.media?.Any(m => m.Id == kvp.Key) == true);
|
||||
isNew = await DownloadPurchasedMedia(kvp.Value, path, kvp.Key, "Messages", progressReporter,
|
||||
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username).MessageFileNameFormat ??
|
||||
string.Empty, messageInfo, mediaInfo, messageInfo?.fromUser, users);
|
||||
@ -3032,9 +3029,11 @@ public class DownloadService(
|
||||
$"https://onlyfans.com/api2/v2/users/media/{parsed[4]}/drm/post/{parsed[5]}?type=widevine",
|
||||
pssh);
|
||||
|
||||
Medium? mediaInfo = purchasedPosts.PaidPostMedia.FirstOrDefault(m => m.id == postKVP.Key);
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
purchasedPosts.PaidPostMedia.FirstOrDefault(m => m.Id == postKVP.Key);
|
||||
Purchased.List? postInfo =
|
||||
purchasedPosts.PaidPostObjects.FirstOrDefault(p => p?.media?.Contains(mediaInfo) == true);
|
||||
purchasedPosts.PaidPostObjects.FirstOrDefault(p =>
|
||||
p?.media?.Any(m => m.Id == postKVP.Key) == true);
|
||||
|
||||
isNew = await DownloadPurchasedPostDRMVideo(parsed[1], parsed[2], parsed[3], parsed[0],
|
||||
decryptionKey, path, lastModified, postKVP.Key, "Posts", progressReporter,
|
||||
@ -3048,9 +3047,10 @@ public class DownloadService(
|
||||
}
|
||||
else
|
||||
{
|
||||
Medium? mediaInfo = purchasedPosts.PaidPostMedia.FirstOrDefault(m => m.id == postKVP.Key);
|
||||
MessageEntities.Medium? mediaInfo =
|
||||
purchasedPosts.PaidPostMedia.FirstOrDefault(m => m.Id == postKVP.Key);
|
||||
Purchased.List? postInfo =
|
||||
purchasedPosts.PaidPostObjects.FirstOrDefault(p => p?.media?.Contains(mediaInfo) == true);
|
||||
purchasedPosts.PaidPostObjects.FirstOrDefault(p => p?.media?.Any(m => m.Id == postKVP.Key) == true);
|
||||
isNew = await DownloadPurchasedPostMedia(postKVP.Value, path, postKVP.Key, "Posts", progressReporter,
|
||||
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username).PostFileNameFormat ??
|
||||
string.Empty, postInfo, mediaInfo, postInfo?.fromUser, users);
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OF_DL.Models;
|
||||
using OF_DL.Models.Messages;
|
||||
using OF_DL.Models.Post;
|
||||
using OF_DL.Models.Purchased;
|
||||
using OF_DL.Models.Streams;
|
||||
using OF_DL.Enumerations;
|
||||
using ArchivedModels = OF_DL.Models.Entities.Archived;
|
||||
using ArchivedEntities = OF_DL.Models.Entities.Archived;
|
||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||
using Spectre.Console;
|
||||
|
||||
namespace OF_DL.Services;
|
||||
@ -28,8 +28,8 @@ public interface IAPIService
|
||||
Task<PostCollection> GetPosts(string endpoint, string folder, List<long> paid_post_ids, StatusContext ctx);
|
||||
Task<SinglePostCollection> GetPost(string endpoint, string folder);
|
||||
Task<StreamsCollection> GetStreams(string endpoint, string folder, List<long> paid_post_ids, StatusContext ctx);
|
||||
Task<ArchivedModels.ArchivedCollection> GetArchived(string endpoint, string folder, StatusContext ctx);
|
||||
Task<MessageCollection> GetMessages(string endpoint, string folder, StatusContext ctx);
|
||||
Task<ArchivedEntities.ArchivedCollection> GetArchived(string endpoint, string folder, StatusContext ctx);
|
||||
Task<MessageEntities.MessageCollection> GetMessages(string endpoint, string folder, StatusContext ctx);
|
||||
Task<PaidMessageCollection> GetPaidMessages(string endpoint, string folder, string username, StatusContext ctx);
|
||||
Task<SinglePaidMessageCollection> GetPaidMessage(string endpoint, string folder);
|
||||
Task<Dictionary<string, long>> GetPurchasedTabUsers(string endpoint, Dictionary<string, long> users);
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
using OF_DL.Models;
|
||||
using ArchivedModels = OF_DL.Models.Entities.Archived;
|
||||
using OF_DL.Models.Messages;
|
||||
using OF_DL.Models.Entities.Common;
|
||||
using ArchivedEntities = OF_DL.Models.Entities.Archived;
|
||||
using OF_DL.Models.Post;
|
||||
using OF_DL.Models.Purchased;
|
||||
using OF_DL.Models.Streams;
|
||||
using static OF_DL.Models.Messages.Messages;
|
||||
using FromUser = OF_DL.Models.Messages.FromUser;
|
||||
using MessageEntities = OF_DL.Models.Entities.Messages;
|
||||
|
||||
namespace OF_DL.Services;
|
||||
|
||||
@ -17,15 +16,15 @@ public interface IDownloadService
|
||||
string serverFileName, string resolvedFileName, string extension, IProgressReporter progressReporter);
|
||||
|
||||
Task<bool> DownloadArchivedMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, ArchivedModels.ListItem? messageInfo,
|
||||
ArchivedModels.Medium? messageMedia, Models.Entities.Common.Author? author,
|
||||
IProgressReporter progressReporter, string? filenameFormat, ArchivedEntities.ListItem? messageInfo,
|
||||
ArchivedEntities.Medium? messageMedia, Author? author,
|
||||
Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadArchivedPostDRMVideo(string policy, string signature, string kvp, string url,
|
||||
string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, ArchivedModels.ListItem? postInfo,
|
||||
ArchivedModels.Medium? postMedia,
|
||||
Models.Entities.Common.Author? author, Dictionary<string, long> users);
|
||||
IProgressReporter progressReporter, string? filenameFormat, ArchivedEntities.ListItem? postInfo,
|
||||
ArchivedEntities.Medium? postMedia,
|
||||
Author? author, Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadPostDRMVideo(string policy, string signature, string kvp, string url, string decryptionKey,
|
||||
string folder, DateTime lastModified, long media_id, string api_type, IProgressReporter progressReporter,
|
||||
@ -41,12 +40,13 @@ public interface IDownloadService
|
||||
|
||||
Task<bool> DownloadMessageDRMVideo(string policy, string signature, string kvp, string url, string decryptionKey,
|
||||
string folder, DateTime lastModified, long media_id, string api_type, IProgressReporter progressReporter,
|
||||
string? filenameFormat, List? messageInfo, Medium? messageMedia, Messages.FromUser? fromUser,
|
||||
string? filenameFormat, MessageEntities.ListItem? messageInfo, MessageEntities.Medium? messageMedia,
|
||||
FromUser? fromUser,
|
||||
Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadMessageMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, List? messageInfo, Medium? messageMedia,
|
||||
Messages.FromUser? fromUser, Dictionary<string, long> users);
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.ListItem? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadPostMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, Post.List? postInfo, Post.Medium? postMedia,
|
||||
@ -58,35 +58,33 @@ public interface IDownloadService
|
||||
|
||||
Task<bool> DownloadPurchasedMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, Purchased.List? messageInfo,
|
||||
Medium? messageMedia,
|
||||
MessageEntities.Medium? messageMedia,
|
||||
Purchased.FromUser? fromUser, Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadSinglePurchasedMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, SingleMessage? messageInfo,
|
||||
Medium? messageMedia,
|
||||
FromUser? fromUser, Dictionary<string, long> users);
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.SingleMessage? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadPurchasedMessageDRMVideo(string policy, string signature, string kvp, string url,
|
||||
string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, Purchased.List? messageInfo,
|
||||
Medium? messageMedia,
|
||||
MessageEntities.Medium? messageMedia,
|
||||
Purchased.FromUser? fromUser, Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadSinglePurchasedMessageDRMVideo(string policy, string signature, string kvp, string url,
|
||||
string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, SingleMessage? messageInfo,
|
||||
Medium? messageMedia,
|
||||
FromUser? fromUser, Dictionary<string, long> users);
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.SingleMessage? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadPurchasedPostDRMVideo(string policy, string signature, string kvp, string url,
|
||||
string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, Purchased.List? postInfo,
|
||||
Medium? postMedia,
|
||||
MessageEntities.Medium? postMedia,
|
||||
Purchased.FromUser? fromUser, Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadPurchasedPostMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, Purchased.List? messageInfo,
|
||||
Medium? messageMedia,
|
||||
MessageEntities.Medium? messageMedia,
|
||||
Purchased.FromUser? fromUser, Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadStoryMedia(string url, string folder, long media_id, string api_type,
|
||||
@ -103,14 +101,12 @@ public interface IDownloadService
|
||||
|
||||
Task<bool> DownloadSingleMessagePreviewDRMVideo(string policy, string signature, string kvp, string url,
|
||||
string decryptionKey, string folder, DateTime lastModified, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, SingleMessage? messageInfo,
|
||||
Medium? messageMedia,
|
||||
FromUser? fromUser, Dictionary<string, long> users);
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.SingleMessage? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users);
|
||||
|
||||
Task<bool> DownloadMessagePreviewMedia(string url, string folder, long media_id, string api_type,
|
||||
IProgressReporter progressReporter, string? filenameFormat, SingleMessage? messageInfo,
|
||||
Medium? messageMedia,
|
||||
FromUser? fromUser, Dictionary<string, long> users);
|
||||
IProgressReporter progressReporter, string? filenameFormat, MessageEntities.SingleMessage? messageInfo,
|
||||
MessageEntities.Medium? messageMedia, FromUser? fromUser, Dictionary<string, long> users);
|
||||
|
||||
Task<DownloadResult> DownloadHighlights(string username, long userId, string path, HashSet<long> paidPostIds,
|
||||
IProgressReporter progressReporter);
|
||||
@ -119,11 +115,11 @@ public interface IDownloadService
|
||||
IProgressReporter progressReporter);
|
||||
|
||||
Task<DownloadResult> DownloadArchived(string username, long userId, string path, Dictionary<string, long> users,
|
||||
bool clientIdBlobMissing, bool devicePrivateKeyMissing, ArchivedModels.ArchivedCollection archived,
|
||||
bool clientIdBlobMissing, bool devicePrivateKeyMissing, ArchivedEntities.ArchivedCollection archived,
|
||||
IProgressReporter progressReporter);
|
||||
|
||||
Task<DownloadResult> DownloadMessages(string username, long userId, string path, Dictionary<string, long> users,
|
||||
bool clientIdBlobMissing, bool devicePrivateKeyMissing, MessageCollection messages,
|
||||
bool clientIdBlobMissing, bool devicePrivateKeyMissing, MessageEntities.MessageCollection messages,
|
||||
IProgressReporter progressReporter);
|
||||
|
||||
Task<DownloadResult> DownloadPaidMessages(string username, string path, Dictionary<string, long> users,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user