Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Possibility of get Video Duration Without Downloading #591

Closed
avatar70t opened this issue Apr 22, 2024 · 1 comment
Closed

[Feat] Possibility of get Video Duration Without Downloading #591

avatar70t opened this issue Apr 22, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@avatar70t
Copy link

avatar70t commented Apr 22, 2024

Proposal

"Thank you very much to the author for developing such a useful program! I would like to inquire whether it's possible to get the duration of a video without downloading it. because when I directly click on a video, the player displays its duration."

Background

None

Workarounds

None

@avatar70t avatar70t added the enhancement New feature or request label Apr 22, 2024
@iyear
Copy link
Owner

iyear commented Apr 23, 2024

Use tdl chat export --raw to export raw Telegram MTProto messages. And there is a video duration field. Unit: seconds

Like:

{
  "id": -1,
  "type": "message",
  "file": "X",
  "raw": {
    "Flags": -1,
    "Out": false,
    "Mentioned": false,
    "MediaUnread": false,
    "Silent": false,
    "Post": false,
    "FromScheduled": false,
    "Legacy": false,
    "EditHide": false,
    "Pinned": false,
    "Noforwards": false,
    "InvertMedia": false,
    "ID": -1,
    "FromID": null,
    "FromBoostsApplied": 0,
    "PeerID": {
      "UserID": -1
    },
    "SavedPeerID": {
      "ChannelID": -1
    },
    "FwdFrom": {
      "Flags": 21,
      "Imported": false,
      "SavedOut": false,
      "FromID": {
        "ChannelID": -1
      },
      "FromName": "",
      "Date": -1,
      "ChannelPost": -1,
      "PostAuthor": "",
      "SavedFromPeer": {
        "ChannelID": -1
      },
      "SavedFromMsgID": -1,
      "SavedFromID": null,
      "SavedFromName": "",
      "SavedDate": 0,
      "PsaType": ""
    },
    "ViaBotID": 0,
    "ReplyTo": null,
    "Date": 1713804899,
    "Message": "",
    "Media": {
      "Flags": 65,
      "Nopremium": false,
      "Spoiler": false,
      "Video": true,
      "Round": false,
      "Voice": false,
      "Document": {
        "Flags": 1,
        "ID": -1,
        "AccessHash": -1,
        "FileReference": "X",
        "Date": -1,
        "MimeType": "video/mp4",
        "Size": 218444362,
        "Thumbs": [
          {
            "Type": "i",
            "Bytes": "X"
          },
          {
            "Type": "m",
            "W": 320,
            "H": 180,
            "Size": 8661
          }
        ],
        "VideoThumbs": null,
        "DCID": 5,
        "Attributes": [
          {
            "Flags": 2,
            "RoundMessage": false,
            "SupportsStreaming": true,
            "Nosound": false,
            "Duration": 839.266,
            "W": 1920,
            "H": 1080,
            "PreloadPrefixSize": 0
          },
          {
            "FileName": "X"
          }
        ]
      },
      "AltDocument": null,
      "TTLSeconds": 0
    },
    "ReplyMarkup": null,
    "Entities": null,
    "Views": -1,
    "Forwards": -1,
    "Replies": {
      "Flags": 0,
      "Comments": false,
      "Replies": 0,
      "RepliesPts": 0,
      "RecentRepliers": null,
      "ChannelID": 0,
      "MaxID": 0,
      "ReadMaxID": 0
    },
    "EditDate": 0,
    "PostAuthor": "",
    "GroupedID": -1,
    "Reactions": {
      "Flags": 0,
      "Min": false,
      "CanSeeList": false,
      "ReactionsAsTags": false,
      "Results": null,
      "RecentReactions": null
    },
    "RestrictionReason": null,
    "TTLPeriod": 0,
    "QuickReplyShortcutID": 0
  }
}

@iyear iyear closed this as completed Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants