Comments (3)
func convertURLToUniqueFileName() -> String {
guard let _ = URL(string: self) else {
fatalError("\(self) is not a valid URL")
}
return self.md5
}
from celestial.
on an out of date branch.
from celestial.
I think using lastPathComponent + md5 is better way to handle filenames.
https://blablabla.com/test.mp4 -> test.mp4 -> 123412341234123412343
sourceURL.lastPathComponent.convertURLToUniqueFileName()
func convertURLToUniqueFileName() -> String {
guard let _ = URL(string: self) else {
fatalError("(self) is not a valid URL")
}
return self.md5
}
It's possible the urls will be too large for file system.
/tmp/. Directory contents: ["httpsd21m91m763fb64.cloudfront.netvideos-540p19f1efb0-8a1e-11eb-8bc7-65134f4b7bab-.mp4", "https:__d21m91m763fb64.cloudfront.net_videos-540p_d9379510-903f-11eb-9a88-f5ff80ee2719-.mp4", "https:__d21m91m763fb64.cloudfront.net_videos-540p_9edc1cd0-a9f1-11eb-b98a-69bcf457ca9a-.mp4", "httpsd21m91m763fb64.cloudfront.netvideos-540pe4b390e0-8560-11eb-822b-3bb0ffb6770c-.mp4", "https:__d21m91m763fb64.cloudfront.net_videos-540p_22114af0-82cc-11eb-a662-35cb0ee94b96-.mp4", "stack-logs.3760.10e1dc000.8secondz.8SFCWk.index", "https:__d21m91m763fb64.cloudfront.net_videos-540p_51180470-9856-11eb-968f-297a20a6926d-.mp4", "instrument", "https:__d21m91m763fb64.cloudfront.net_videos-540p_b28a8d60-7dfb-11eb-aff5-433e586b7aee-.mp4
I can't explain why - but I'm seeing inexplicable failure to move the file from tmp to Celestial folder.
I'll draft a new branch with last path component for your review.
from celestial.
Related Issues (20)
- XIB support
- restrict download / prefecting size to 1mb
- A background URLSession with identifier .... already exists!
- Add validation for URLs
- Replace all uses of count == 0 with isEmpty HOT 1
- Fix issue where URLVideoPlayerView will force the video format
- Replace background thread executions with the Utility QoS
- Investigate issue with new downloads firing for cached videos HOT 1
- Add disclaimer for insecure URLs
- Fix uncaught bug where downloaded video files would not override existing ones HOT 1
- Implement Unit Tests
- Change the function used for URLVideoPlayerView when storing to the memory cache
- Replace the singleton structure of the AssetExportManager with static or class functions HOT 1
- Add a common type alias for URL/Error completion blocks
- Address warnings about using class instead of AnyObject
- Update the docs to include information about pausing and resuming downloads HOT 1
- Fix issue with loading URLs with no file extension HOT 1
- Clarification on saving / storing videos to user documents. HOT 2
- Documentation on prefetching.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from celestial.