Skip to content

Commit

Permalink
^q^
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtBestor committed Nov 22, 2021
1 parent f729633 commit 296d7c6
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 26 deletions.
9 changes: 5 additions & 4 deletions src/extractor/artstation_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Image(object):

def __init__(self, post_url, date, url, page):
self.post_url = post_url
self.url = LazyUrl(post_url, lambda _: url, self)
self.url = LazyUrl(post_url, lambda _: url.replace('/large/', '/4k/'), self, url)
self.page = page
name = post_url.split('/')[(-1)]
ext = os.path.splitext(url.split('?')[0])[1]
Expand All @@ -31,10 +31,11 @@ class Downloader_artstation(Downloader):
def init(self):
self.url_main = 'https://www.artstation.com/{}'.format(self.id.replace('artstation_', '', 1).replace('/', '/'))

if '/artwork/' in self.url:
if '/artwork/' in self.url or '/projects/' in self.url:
pass#raise NotImplementedError('Single post')
else:
self.url = self.url_main
self.print_(self.url)

# 3849
self.session = Session('chrome')
Expand All @@ -61,7 +62,7 @@ def read(self):
id = id.split('/')[0]
else:
type = None
if '/artwork/' in self.url:
if '/artwork/' in self.url or '/projects/' in self.url:
id_art = get_id_art(self.url)
imgs = get_imgs_page(id_art, self.session, cw=self.cw)
else:
Expand Down Expand Up @@ -130,7 +131,7 @@ def get_imgs(id, title, session, type=None, cw=None):


def get_id_art(post_url):
return post_url.split('/artwork/')[1].split('/')[0]
return post_url.split('/artwork/')[-1].split('/projects/')[-1].split('/')[0].split('?')[0].split('#')[0]


def get_id(url, cw=None):
Expand Down
3 changes: 3 additions & 0 deletions src/extractor/insta_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def read_html(url, session, cw):

def check_error(soup, cw, wait):
print_ = get_print(cw)

if len(soup.html) < 1000: #4014
raise errors.LoginRequired(soup.html)

err = soup.find('div', class_='error-container')
if err:
Expand Down
2 changes: 1 addition & 1 deletion src/extractor/nico_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import nndownload
from io import BytesIO
import ree as re
from utils import Downloader, get_print, compatstr, format_filename, clean_title, try_n, LazyUrl, get_abr
from utils import Downloader, get_print, compatstr, format_filename, try_n, LazyUrl, get_abr
import utils
from nico_login import login, logout
import ffmpeg
Expand Down
4 changes: 2 additions & 2 deletions src/extractor/sankaku_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def id(self):
if self.type_sankaku == 'www':
id = '[www] ' + self.soup.find('h1', class_='entry-title').text.strip()
else:
if '/post/' in self.url:
if '/post/show/' in self.url:
id = get_id(self.url)
else:
qs = query_url(self.url)
Expand Down Expand Up @@ -241,7 +241,7 @@ def get_imgs(url, title=None, cw=None, d=None, types=['img', 'gif', 'video'], se
info = {}
info['single'] = False

if '/post/' in url:
if '/post/show/' in url:
info['single'] = True
id = get_id(url)
info['imgs'] = [Image(type, id, url, None, cw=cw, d=d)]
Expand Down
25 changes: 8 additions & 17 deletions src/extractor/tiktok_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ def read(self):
self.urls.append(video.url)
self.title = clean_title(video.title)

self.setIcon(video.thumb)



class Video(object):
_url = None
Expand All @@ -80,10 +77,6 @@ def get(self, url):
ydl = ytdl.YoutubeDL()
info = ydl.extract_info(url)

self.url_thumb = info['thumbnail']
self.thumb = BytesIO()
downloader.download(self.url_thumb, referer=url, buffer=self.thumb)

self._url = info['url']

return self._url
Expand All @@ -99,21 +92,20 @@ def read_channel(url, session, cw=None):
info['items'] = []
sd = {
'count_empty': 0,
'shown': False,
'shown': SHOW,
}

max_pid = get_max_range(cw)

def f(html, browser=None):
soup = Soup(html)
if not SHOW:
if is_captcha(soup):
print('captcha')
browser.show()
sd['shown'] = True
elif sd['shown']:
browser.hide()
sd['shown'] = False
if is_captcha(soup):
print('captcha')
browser.show()
sd['shown'] = True
elif sd['shown'] and not SHOW:
browser.hide()
sd['shown'] = False
try:
st = soup.find('h2', class_='share-title')
if st is None:
Expand All @@ -125,7 +117,6 @@ def f(html, browser=None):
info['nickname'] = st.text.strip()
except Exception as e:
print_(print_error(e)[0])
print_(info)
c = 0
ids_now = set()
items = soup.findAll('div', class_='video-feed-item') + soup.findAll('div', class_=lambda c: c and 'DivItemContainer' in c)
Expand Down
8 changes: 6 additions & 2 deletions src/extractor/xhamster_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Downloader.register
class Downloader_xhamster(Downloader):
type = 'xhamster'
__name = r'(xhamster|xhwebsite)[0-9]*' #3881
__name = r'(xhamster|xhwebsite|xhofficial|xhlocal|xhopen|xhtotal)[0-9]*' #3881
URLS = [
r'regex:{}\.[a-z0-9]+/videos/'.format(__name),
r'regex:{}\.[a-z0-9]+/users/'.format(__name),
Expand All @@ -28,7 +28,11 @@ def init(self):

@classmethod
def fix_url(cls, url):
return re.sub(cls.__name, r'\1', url)
return re.sub(cls.__name, r'\1', url, 1)

@classmethod
def key_id(cls, url):
return re.sub(cls.__name+r'\.[^/]+', 'domain', url, 1)

def read(self):
cw = self.cw
Expand Down
37 changes: 37 additions & 0 deletions translation/changelog_en.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
3.7d 【】

[버그 해결 / 사이트 변경에 의한 수정]

- SankakuComplex 일부 URL 잘못 인식하는 문제 해결 (#3990)

- 일부 환경에서 토렌트 다운로드 안 되는 문제 해결 (#3998)

- #3951

- 오래된 설정파일 (*.ini) 읽지 못하는 문제 해결 (#4025)

- KAKAO WEBTOON 안정화 (#4009)

- Hitomi.la 업데이트 대응 (#4037, #4038)

- 기타 자잘한 것들


[변경/추가된 기능]

- E(x)Hentai "Always use the Multi-Page Viewer" 지원 (#3415)

- HTTP API 지원
옵션 - 설정 - 고급 설정 - HTTP API

- "브라우저로 보기" 수정

- ArtStation 더 좋은 화질로 다운로드 (#2600, #4039)

- Instagram 오래된 쿠키 경고 메시지 (#4014)

- 기타 자잘한 것들



--------------------------------------------------------------------------------------------------------------------------------------------
3.7c 2021-11-05

[Bug Resolution / Fix due to site change]
Expand Down
37 changes: 37 additions & 0 deletions translation/changelog_ko.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
3.7d 【】

[버그 해결 / 사이트 변경에 의한 수정]

- SankakuComplex 일부 URL 잘못 인식하는 문제 해결 (#3990)

- 일부 환경에서 토렌트 다운로드 안 되는 문제 해결 (#3998)

- #3951

- 오래된 설정파일 (*.ini) 읽지 못하는 문제 해결 (#4025)

- KAKAO WEBTOON 안정화 (#4009)

- Hitomi.la 업데이트 대응 (#4037, #4038)

- 기타 자잘한 것들


[변경/추가된 기능]

- E(x)Hentai "Always use the Multi-Page Viewer" 지원 (#3415)

- HTTP API 지원
옵션 - 설정 - 고급 설정 - HTTP API

- "브라우저로 보기" 수정

- ArtStation 더 좋은 화질로 다운로드 (#2600, #4039)

- Instagram 오래된 쿠키 경고 메시지 (#4014)

- 기타 자잘한 것들



--------------------------------------------------------------------------------------------------------------------------------------------
3.7c 【Nov 05, 2021】

[버그 해결 / 사이트 변경에 의한 수정]
Expand Down

0 comments on commit 296d7c6

Please sign in to comment.