Skip to content

Commit

Permalink
Remove media URL special casing
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Feb 8, 2024
1 parent 289a42d commit 62a74a5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions download.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,7 @@ func (cli *Client) DownloadMediaWithPath(directPath string, encFileHash, fileHas
}
for i, host := range mediaConn.Hosts {
// TODO omit hash for unencrypted media?
var mediaURL string
if cli.MessengerConfig != nil {
mediaURL = fmt.Sprintf("https://%s%s", host.Hostname, directPath)
} else {
mediaURL = fmt.Sprintf("https://%s%s&hash=%s&mms-type=%s&__wa-mms=", host.Hostname, directPath, base64.URLEncoding.EncodeToString(encFileHash), mmsType)
}
mediaURL := fmt.Sprintf("https://%s%s&hash=%s&mms-type=%s&__wa-mms=", host.Hostname, directPath, base64.URLEncoding.EncodeToString(encFileHash), mmsType)
data, err = cli.downloadAndDecrypt(mediaURL, mediaKey, mediaType, fileLength, encFileHash, fileHash)
if err == nil {
return
Expand Down

0 comments on commit 62a74a5

Please sign in to comment.