• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Fanbox downloader


Commit MetaInfo

Revisionf8beef3db647d7bea12f935d3d4bcb2b52e3e8b4 (tree)
Time2023-12-10 12:42:47
Authorsupercell <stigma@disr...>
Commitersupercell

Log Message

Handle default embed_map type

Change Summary

Incremental Difference

--- a/fanbox_down.py
+++ b/fanbox_down.py
@@ -465,7 +465,13 @@ def download_article(config, info):
465465 print('<a href="https://fanbox.cc/@{}/posts/{}">{}</a>'.format(
466466 embed_creator, embed_id, embed_title), file=url_embeds_file)
467467 else:
468- print(embed_map['html'] + '\n', file=url_embeds_file)
468+ assert embed_map['type'] == 'default', 'Unknown embed_map type: {}'.format(embed_map['type'])
469+ print('<div style="border:1px solid grey">\n', file=url_embeds_file)
470+ print('<p>{}</p>\n'.format(embed_map['host']),
471+ file=url_embeds_file)
472+ print('<p><a href="{}">{}</a></p>\n'.format(embed_map['url'],
473+ embed_map['url']), file=url_embeds_file)
474+ print('</div>\n', file=url_embeds_file)
469475 # Print embedID to content.txt
470476 print("[embed:{}]".format(embedId), file=content_file)
471477