mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Do not parse PhotoStrippedSize
This commit is contained in:
parent
384f4eba71
commit
c87177e7a6
@ -16,7 +16,7 @@
|
|||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from typing import List
|
from typing import List, Optional
|
||||||
|
|
||||||
import pyrogram
|
import pyrogram
|
||||||
from pyrogram import raw
|
from pyrogram import raw
|
||||||
@ -80,10 +80,13 @@ class Photo(Object):
|
|||||||
self.thumbs = thumbs
|
self.thumbs = thumbs
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(client, photo: "raw.types.Photo", ttl_seconds: int = None) -> "Photo":
|
def _parse(client, photo: "raw.types.Photo", ttl_seconds: int = None) -> Optional["Photo"]:
|
||||||
if isinstance(photo, raw.types.Photo):
|
if isinstance(photo, raw.types.Photo):
|
||||||
big = photo.sizes[-1]
|
big = photo.sizes[-1]
|
||||||
|
|
||||||
|
if isinstance(big, raw.types.PhotoStrippedSize):
|
||||||
|
return None
|
||||||
|
|
||||||
if isinstance(big, raw.types.PhotoSizeProgressive):
|
if isinstance(big, raw.types.PhotoSizeProgressive):
|
||||||
big = raw.types.PhotoSize(
|
big = raw.types.PhotoSize(
|
||||||
type=big.type,
|
type=big.type,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user