A3M4 / YouTube-Report

:bar_chart: Generate a personal YouTube report from your Google Takeout data
MIT License
643 stars 61 forks source link

Added support for MacOS #4

Closed Brithub closed 4 years ago

Brithub commented 4 years ago

Lowercase "arial" threw an error, and MacOS doesn't have a startfile function

A3M4 commented 4 years ago

Lowercase "arial" threw an error, and MacOS doesn't have a startfile function Thanks for your contribution. but this gives an error on windows: "OSError: cannot open resource"

michaelkamau commented 4 years ago

I experienced the issues @Brithub mentioned. I have tested with his branch and it works well. Thanks for the fix

Brithub commented 4 years ago

Added a conditional to the font name, silly that it matters

A3M4 commented 4 years ago

Added a conditional to the font name, silly that it matters

it still returns error when generating word cloud

Generating Word Cloud.....
Traceback (most recent call last):
  File "C:/Users/Yifeng/Desktop/Personal-YouTube-PDF-Report-Generator-master/report.py", line 244, in <module>
    visual.wordCloud()
  File "C:/Users/Yifeng/Desktop/Personal-YouTube-PDF-Report-Generator-master/report.py", line 88, in wordCloud
    max_words=380,contour_width=2, prefer_horizontal=1).generate(unique_string)
  File "C:\Users\Yifeng\lib\site-packages\wordcloud\wordcloud.py", line 619, in generate
    return self.generate_from_text(text)
  File "C:\Users\Yifeng\lib\site-packages\wordcloud\wordcloud.py", line 601, in generate_from_text
    self.generate_from_frequencies(words)
  File "C:\Users\Yifeng\lib\site-packages\wordcloud\wordcloud.py", line 434, in generate_from_frequencies
    max_font_size=self.height)
  File "C:\Users\Yifeng\lib\site-packages\wordcloud\wordcloud.py", line 483, in generate_from_frequencies
    font = ImageFont.truetype(self.font_path, font_size)
  File "C:\Users\Yifeng\lib\site-packages\PIL\ImageFont.py", line 640, in truetype
    return freetype(font)
  File "C:\Users\Yifeng\lib\site-packages\PIL\ImageFont.py", line 637, in freetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "C:\Users\Yifeng\lib\site-packages\PIL\ImageFont.py", line 186, in __init__
    font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
kHarshit commented 4 years ago

Same problem on linux

Brithub commented 4 years ago

Apparently "arial" != "ariel"