본문 바로가기

[IT/Programming]/HTML related

틱톡 (TikTok) | weverse.io 퍼오는 법

728x90
반응형
# 틱톡 (TikTok) | weverse.io 퍼오는 법 천천히 정리할 예정. ## PH
  • 2023-09-18 : First posting.
## TOC ## 틱톡 (TikTok) 링크: https://www.tiktok.com/@hxxax__/video/7279098301746613511 ```[.linenums.lang-html] <style> .rC {margin:.5em 0} .rC>.rSC {position:relative; height:0; padding-bottom:63%} .rC>.rSC>* {position:absolute; width:100%; height:100%; max-width:100%; max-height:100%; left:0; top:0; overflow-x:hidden; overflow-y:hidden} </style> <blockquote class="tiktok-embed" cite="https://www.tiktok.com/@hxxax__/video/7279098301746613511" data-video-id="7279098301746613511" style="max-width: 605px;min-width: 325px;" > <section> <a target="_blank" title="@hxxax__" href="https://www.tiktok.com/@hxxax__?refer=embed">@hxxax__</a> <p>혜안 몰리와 띵띵땅땅 댄스</p> <a target="_blank" title="♬ 오리지널 사운드 - 혜안" href="https://www.tiktok.com/music/오리지널-사운드-혜안-7279098476896586498?refer=embed">♬ 오리지널 사운드 - 혜안</a> </section> </blockquote> <script async src="https://www.tiktok.com/embed.js"></script> <div class="rC"><div class="rSC"> <iframe name="__tt_embed__v74968568392106910" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/embed/v2/7279098301746613511" style="width: 100%; height: 781px; display: block; visibility: unset;" scrolling="yes"></iframe> </div></div> <div class="cBoth"></div> <div class="rC"><div class="rSC" style="overflow-x:hidden; overflow-y:scroll"> <iframe name="__tt_embed__v74968568392106910" sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin" src="https://www.tiktok.com/embed/v2/7279098301746613511" style="width: 100%; height: 781px; display: block; visibility:auto" scrolling="yes"></iframe> </div></div> ```/
@hxxax__

혜안 몰리와 띵띵땅땅 댄스

♬ 오리지널 사운드 - 혜안
### https://vt.tiktok.com/(\w+)/ 형태의 URI 일 경우. 이건 web client 를 돌리는 경우에만 iframe 형태의 Full URI 로 뽑아낼 수 있는거 같음. 아래는 FullURI 끄집어내는 code 일부분. ```[.linenums.lang-java] RecoeveWebClient recoeveWebClient=new RecoeveWebClient(); recoeveWebClient.webClient.headAbs(shortURI) .send() .onSuccess(response -> { if (response.statusCode()==200) { // The response is a redirect, so get the followedRedirects(). List<String> followedURIs=response.followedRedirects(); String fullURI=followedURIs.get(followedURIs.size()-1); System.out.println("Full TikTok URL: "+fullURI); pl.req.response().putHeader("Content-Type","text/plain; charset=utf-8") .end(fullURI, ENCODING); } else { System.out.println("Sended shortURI."); pl.req.response().putHeader("Content-Type","text/plain; charset=utf-8") .end(shortURI, ENCODING); } recoeveWebClient.webClient.close(); }) .onFailure(throwable -> { throwable.printStackTrace(); System.out.println("Sended shortURI."); pl.req.response().putHeader("Content-Type","text/plain; charset=utf-8") .end(shortURI, ENCODING); recoeveWebClient.webClient.close(); }); ```/ 아래는 RecoeveWebClient.java File. ```[.linenums.lang-java] package recoeve.http; import io.vertx.ext.web.client.HttpResponse; import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; public class RecoeveWebClient { public static final WebClientOptions options=new WebClientOptions().setMaxHeaderSize(16384).setFollowRedirects(true); public WebClient webClient; public long timerId; public int timerN; public RecoeveWebClient() { webClient=WebClient.create(Recoeve.vertx, options); timerN=0; } public void doUntilH1IsFound(HttpResponse response, PrintLog pl, int delay) { timerId=Recoeve.vertx.setTimer(delay, timerHandler -> { timerN++; if (response.statusCode()==200) { String body=response.bodyAsString(); Document document=Jsoup.parse(body); // Select the first <h1> element and extract its text content Elements h1Elements=document.select("title, h1"); if (h1Elements.isEmpty()&&timerN<7) { doUntilH1IsFound(response, pl, delay+512); } else { if (!h1Elements.isEmpty()) { Element firstH1Element=h1Elements.first(); String h1Text=firstH1Element.text(); System.out.println("Content of the first <h1> tag: "+h1Text); pl.req.response().putHeader("Content-Type","text/plain; charset=utf-8") .end(h1Text, Recoeve.ENCODING); } else { System.out.println("No <h1> tags found on the page."); pl.req.response().putHeader("Content-Type","text/plain; charset=utf-8") .end("No <h1> tag.", Recoeve.ENCODING); } } } }); } public static void main(String... args) { // Do nothing. } } ```/ ### Recoeve.net 이용하기 다음과 같은 링크로 연결하면 https://recoeve.net/reco?uri=https://www.tiktok.com/@ganadaba/video/7280762870080556306&title=230527 ITZY - Cheshire 유나 직캠 2023 드림콘서트 #itzy #fancam #cheshire #dreamconcert #yuna&cats=[Music/Break]--K-Pop--FanCam 아래와 같이 뜸.
Direct reco example.
iframe of direct reco page.
Recoeve.net 에 가입해서 TikTok URI 를 reco 하고 drag copy & paste (드래그 후 복붙) 로 블로그 같은데 긁어넣으면 됨. (요새 WYSWYG (What You See is What You Get) 편집기들이 바뀌어서 제대로 복붙이 안되는듯 ㅡㅜ) ## weverse.io scrolling="yes" 가 중요함. 그래야 화면이 잘려도 스크롤바가 생김. ```[.linenums.lang-html] <style> .rC {margin:.5em 0} .rC>.rSC {position:relative; height:0; padding-bottom:63%} .rC>.rSC>* {position:absolute; width:100%; height:100%; max-width:100%; max-height:100%; left:0; top:0; overflow-x:hidden; overflow-y:hidden} </style> <div class="rC"><div class="rSC"> <iframe delayed-src="https://weverse.io/lesserafim/artist/3-133358981" frameborder="0" scrolling="yes"></iframe> </div></div> ```/
### Recoeve.net 이용하기 다음과 같은 링크로 연결하면 https://recoeve.net/reco?uri=https://weverse.io/lesserafim/artist/3-133358981&title=쥬하🌿: 오늘은 비가 진짜 많이 오네요🌧️. 피어나 감기 조심하고 안전하게 집 들어가요. 잘 자아아아.&cats=[Music/Break]--LE SSERAFIM 아래와 같이 뜸.
Direct reco example.
iframe of direct reco page.
Recoeve.net 에 가입해서 Weverse URI 를 reco 하고 drag copy & paste (드래그 후 복붙) 로 블로그 같은데 긁어넣으면 됨. (요새 WYSWYG (What You See is What You Get) 편집기들이 바뀌어서 제대로 복붙이 안되는듯 ㅡㅜ) ## RRA
  1. https://www.tiktok.com/ko-KR/
  2. https://weverse.io/
728x90
반응형