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

Update libraries #86

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iiify/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
cors = CORS(app) if cors else None
cache = Cache(app)

ARCHIVE = 'http://archive.org'
ARCHIVE = 'https://archive.org'

# cache.init_app(app)

Expand Down
84 changes: 42 additions & 42 deletions iiify/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,50 +722,50 @@ def create_manifest3(identifier, domain=None, page=None):
duration = float(file['length'])
filedata = file

# create the canvases for each original
for file in [f for f in originals if f['format'] in ['MPEG4', 'h.264 HD', 'h.264 MPEG4', '512Kb MPEG4', 'HiRes MPEG4', 'MPEG2', 'h.264', 'Matroska', 'Ogg Video', 'Ogg Theora', 'WebM', 'Windows Media', 'Cinepack','QuickTime']]:
normalised_id = file['name'].rsplit(".", 1)[0]
slugged_id = normalised_id.replace(" ", "-")
c_id = f"{URI_PRIFIX}/{identifier}/{slugged_id}/canvas"
c = Canvas(id=c_id, label=normalised_id, duration=duration, height=int(filedata['height']), width=int(filedata['width']))

ap = AnnotationPage(id=f"{URI_PRIFIX}/{identifier}/{slugged_id}/page")

vttAPId = f"{URI_PRIFIX}/{identifier}/{slugged_id}/vtt"
vtAnno = c.make_annotation(id=f"{URI_PRIFIX}/{identifier}/{slugged_id}/annotation/vtt/streamed",
motivation="supplementing",
target=c.id,
anno_page_id=vttAPId,
body={"id": f"{domain}vtt/streaming/{identifier}.vtt",
"type": "Text",
"format": "text/vtt",
})
# create the canvases for each original
for file in [f for f in originals if f['format'] in ['MPEG4', 'h.264 HD', 'h.264 MPEG4', '512Kb MPEG4', 'HiRes MPEG4', 'MPEG2', 'h.264', 'Matroska', 'Ogg Video', 'Ogg Theora', 'WebM', 'Windows Media', 'Cinepack','QuickTime']]:
normalised_id = file['name'].rsplit(".", 1)[0]
slugged_id = normalised_id.replace(" ", "-")
c_id = f"{URI_PRIFIX}/{identifier}/{slugged_id}/canvas"
c = Canvas(id=c_id, label=normalised_id, duration=duration, height=int(filedata['height']), width=int(filedata['width']))

segments = math.floor(duration / 60)
for i in range(segments):
start = i * 60
if i == segments - 1:
end = int(duration)
else:
end = (i + 1) * 60

#print (f"Start: {start} End: {end}, Duration: {float(end) - float(start)} full duration: {duration}")
anno = Annotation(id=f"{URI_PRIFIX}/{identifier}/{slugged_id}/annotation/{i}", motivation="painting", target=f"{c.id}#t={start},{end}")
streamurl = f"https://{metadata['server']}{metadata['dir']}/{mp4File}?start={start}&end={end}&ignore=x.mp4&cnt=0"
body = ResourceItem(id=streamurl,
type='Video',
format="video/mp4",
label={"en": [f"Part {i + 1} of {segments}"]},
duration=end - start,
height=int(filedata['height']),
width=int(filedata['width']),
)
ap = AnnotationPage(id=f"{URI_PRIFIX}/{identifier}/{slugged_id}/page")

anno.body = body
ap.add_item(anno)

c.add_item(ap)
manifest.add_item(c)
vttAPId = f"{URI_PRIFIX}/{identifier}/{slugged_id}/vtt"
vtAnno = c.make_annotation(id=f"{URI_PRIFIX}/{identifier}/{slugged_id}/annotation/vtt/streamed",
motivation="supplementing",
target=c.id,
anno_page_id=vttAPId,
body={"id": f"{domain}vtt/streaming/{identifier}.vtt",
"type": "Text",
"format": "text/vtt",
})

segments = math.floor(duration / 60)
for i in range(segments):
start = i * 60
if i == segments - 1:
end = int(duration)
else:
end = (i + 1) * 60

#print (f"Start: {start} End: {end}, Duration: {float(end) - float(start)} full duration: {duration}")
anno = Annotation(id=f"{URI_PRIFIX}/{identifier}/{slugged_id}/annotation/{i}", motivation="painting", target=f"{c.id}#t={start},{end}")
streamurl = f"https://{metadata['server']}{metadata['dir']}/{mp4File}?start={start}&end={end}&ignore=x.mp4&cnt=0"
body = ResourceItem(id=streamurl,
type='Video',
format="video/mp4",
label={"en": [f"Part {i + 1} of {segments}"]},
duration=end - start,
height=int(filedata['height']),
width=int(filedata['width']),
)

anno.body = body
ap.add_item(anno)

c.add_item(ap)
manifest.add_item(c)
else:
# create the canvases for each original
for file in [f for f in originals if f['format'] in ['MPEG4', 'h.264 MPEG4', '512Kb MPEG4', 'HiRes MPEG4', 'MPEG2', 'h.264', 'Matroska', 'Ogg Video', 'Ogg Theora', 'WebM', 'Windows Media', 'Cinepack']]:
Expand Down
215 changes: 0 additions & 215 deletions iiify/static/js/annotations.js

This file was deleted.

24 changes: 0 additions & 24 deletions iiify/static/js/app.js

This file was deleted.

Loading
Loading